change void* -> char* for string attr

This commit is contained in:
Zhoulong Jiang 2020-12-03 11:01:57 +00:00
parent 21135f9a88
commit c7f3d3f943
2 changed files with 4 additions and 4 deletions

View File

@ -388,7 +388,7 @@ DEFINE_TF_GETATTR(Float, float, float, "float", f)
DEFINE_TF_GETATTR(Bool, TF_Bool, bool, "bool", b)
void TF_OpKernelConstruction_GetAttrString(TF_OpKernelConstruction* ctx,
const char* attr_name, void* value,
const char* attr_name, char* value,
size_t max_length,
TF_Status* status) {
std::string v;
@ -406,7 +406,7 @@ void TF_OpKernelConstruction_GetAttrString(TF_OpKernelConstruction* ctx,
void TF_OpKernelConstruction_GetAttrStringList(TF_OpKernelConstruction* ctx,
const char* attr_name,
void** values, size_t* lengths,
char** values, size_t* lengths,
int max_values, void* storage,
size_t storage_size,
TF_Status* status) {

View File

@ -256,7 +256,7 @@ TF_CAPI_EXPORT extern void TF_OpKernelConstruction_GetAttrBool(
// If the attribute could not be found or could not be interpreted as
// string, *status is populated with an error.
TF_CAPI_EXPORT extern void TF_OpKernelConstruction_GetAttrString(
TF_OpKernelConstruction* ctx, const char* attr_name, void* val,
TF_OpKernelConstruction* ctx, const char* attr_name, char* val,
size_t max_length, TF_Status* status);
// Interprets the named kernel construction attribute as a TF_DataType array and
@ -318,7 +318,7 @@ TF_CAPI_EXPORT extern void TF_OpKernelConstruction_GetAttrBoolList(
// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size,
// total_size).
TF_CAPI_EXPORT extern void TF_OpKernelConstruction_GetAttrStringList(
TF_OpKernelConstruction* ctx, const char* attr_name, void** vals,
TF_OpKernelConstruction* ctx, const char* attr_name, char** vals,
size_t* lengths, int max_values, void* storage, size_t storage_size,
TF_Status* status);