Results 18 comments of Allen

Yes, you are right. std::span defined in c++20. Maybe we can use the standard span if using compiler supported c++20.

> https://en.cppreference.com/w/cpp/utility/feature_test https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html Maybe check __cpp_lib_span, and use std::span if it is available, otherwise use the self defined version. > […](#) > On Wed, Nov 4, 2020, 00:33 Allen ***@***.***>...

Add test for span in c++17 and c++20 and test passed.

You're really serious. LOL. I got an `std::runtime_error' undefined when i remove . Fixed it by the way.

> I guess I need to go through the source code to see how TF manages memory internally. My first speculation is that TF_Tensor is RefCounted, so we should be...

``` if (src.dtype() == DT_RESOURCE) { // ... // This branch is unsafe. const string str = src.scalar()().SerializeAsString(); TF_Tensor* t = TF_AllocateTensor(TF_RESOURCE, {}, 0, str.size()); std::memcpy(TF_TensorData(t), str.c_str(), str.size()); return t;...

I use AddressSanitizer detected some memory leak and fixed it. The method get_data really has a memory leak. But we can directly use this->tf_tensor obtaining raw data. It should be...

You know, the `get_data` method's type is const-qualified, so modify this->tf_tensor seems unreasonable unless you redesign the method sematic to non-const or let`this->tf_tensor` mutable.

> @ivanallen Why is this closed? I think it is still worth discussing at least. > > @serizba I would also like to know your opinion on this before I...

> @ivanallen Finally, we are ready to work on this PR :) > > First, could you clean up this PR a bit? Include the following: > > 1. Rebase...