aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/pywrap_tfe.i
diff options
context:
space:
mode:
authorGravatar Ben <bstriner@gmail.com>2018-08-26 15:41:10 -0400
committerGravatar Ben <bstriner@gmail.com>2018-08-26 15:41:10 -0400
commit32d4ffeb95a344fde6a1b956a4a8d6792432bf15 (patch)
tree1b4df7785e3cd502a107993e3effb799d2b80e7f /tensorflow/python/pywrap_tfe.i
parentc521738635ed5c50e31be2e87305e49c7dfeb601 (diff)
comments
Diffstat (limited to 'tensorflow/python/pywrap_tfe.i')
-rwxr-xr-xtensorflow/python/pywrap_tfe.i9
1 files changed, 9 insertions, 0 deletions
diff --git a/tensorflow/python/pywrap_tfe.i b/tensorflow/python/pywrap_tfe.i
index bc02e9a35c..e1c233cdd9 100755
--- a/tensorflow/python/pywrap_tfe.i
+++ b/tensorflow/python/pywrap_tfe.i
@@ -105,10 +105,16 @@ limitations under the License.
}
}
+// For const parameters in a function, SWIG pretty much ignores the const.
+// See: http://www.swig.org/Doc2.0/SWIG.html#SWIG_nn13
+// Hence the 'const_cast'.
%typemap(in) const char* serialized_function_def {
$1 = const_cast<char*>(TFE_GetPythonString($input));
}
+// For const parameters in a function, SWIG pretty much ignores the const.
+// See: http://www.swig.org/Doc2.0/SWIG.html#SWIG_nn13
+// Hence the 'const_cast'.
%typemap(in) const char* device_name {
if ($input == Py_None) {
$1 = nullptr;
@@ -117,6 +123,9 @@ limitations under the License.
}
}
+// For const parameters in a function, SWIG pretty much ignores the const.
+// See: http://www.swig.org/Doc2.0/SWIG.html#SWIG_nn13
+// Hence the 'const_cast'.
%typemap(in) const char* op_name {
$1 = const_cast<char*>(TFE_GetPythonString($input));
}