size_t len_;
#if (TF_MAJOR_VERSION == 1 && TF_MINOR_VERSION < 13)
+ explicit TFBuffer (void* data_ptr) : data_(data_ptr) {}
void* data () const override { return data_; }
+#elif (TF_MAJOR_VERSION == 1 && TF_MINOR_VERSION >= 13)
+ explicit TFBuffer (void* data_ptr) : TensorBuffer (data_ptr) {}
+#else
+#error This supports Tensorflow 1.x only.
#endif
+
size_t size () const override { return len_; }
TensorBuffer* root_buffer () override { return this; }
void FillAllocationDescription (AllocationDescription* proto) const override {
}
/* this input tensor should be UNREF */
- buf = new TFBuffer;
+ buf = new TFBuffer (input[i].data);
buf->len_ = input[i].size;
- buf->data_ = input[i].data;
in = TensorCApi::MakeTensor (
dataType,