Private method used to set an attribute in the node_def.
(self, attr_name, attr_value)
| 2319 | self._traceback, include_func_start_lineno=True) |
| 2320 | |
| 2321 | def _set_attr(self, attr_name, attr_value): |
| 2322 | """Private method used to set an attribute in the node_def.""" |
| 2323 | buf = c_api.TF_NewBufferFromString( |
| 2324 | compat.as_bytes(attr_value.SerializeToString())) |
| 2325 | try: |
| 2326 | # pylint: disable=protected-access |
| 2327 | c_api.SetAttr(self._graph._c_graph, self._c_op, attr_name, buf) |
| 2328 | # pylint: enable=protected-access |
| 2329 | finally: |
| 2330 | c_api.TF_DeleteBuffer(buf) |
| 2331 | |
| 2332 | def _set_func_attr(self, attr_name, func_name): |
| 2333 | """Private method used to set a function attribute in the node_def.""" |