Updates apiDefMap with the overrides specified in `data`. data - ApiDef text proto.
(data string)
| 84 | // |
| 85 | // data - ApiDef text proto. |
| 86 | func (m *apiDefMap) Put(data string) error { |
| 87 | cdata := C.CString(data) |
| 88 | defer C.free(unsafe.Pointer(cdata)) |
| 89 | status := C.TF_NewStatus() |
| 90 | defer C.TF_DeleteStatus(status) |
| 91 | C.TF_ApiDefMapPut(m.c, cdata, C.size_t(len(data)), status) |
| 92 | if C.TF_GetCode(status) != C.TF_OK { |
| 93 | return errors.New(C.GoString(C.TF_Message(status))) |
| 94 | } |
| 95 | return nil |
| 96 | } |
| 97 | |
| 98 | // Returns ApiDef proto instance for the TensorFlow operation |
| 99 | // named `opname`. |