Commit ccdb7721 authored by Davis King's avatar Davis King

Made tensor copies a little more efficient.

parent a66a24f3
...@@ -292,15 +292,13 @@ namespace dlib ...@@ -292,15 +292,13 @@ namespace dlib
resizable_tensor(const resizable_tensor& item) : _annotation(item.annotation()) resizable_tensor(const resizable_tensor& item) : _annotation(item.annotation())
{ {
// TODO, do the copy with cuda?
copy_size(item); copy_size(item);
std::memcpy(data_instance.host(), item.host(), data_instance.size()*sizeof(float)); memcpy(data_instance, item.data_instance);
} }
resizable_tensor(const tensor& item) : _annotation(item.annotation()) resizable_tensor(const tensor& item) : _annotation(item.annotation())
{ {
// TODO, do the copy with cuda?
copy_size(item); copy_size(item);
std::memcpy(data_instance.host(), item.host(), data_instance.size()*sizeof(float)); memcpy(*this, item);
} }
resizable_tensor(resizable_tensor&& item) { swap(item); } resizable_tensor(resizable_tensor&& item) { swap(item); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment