MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CopyFromInternal

Method CopyFromInternal

tensorflow/core/framework/tensor.cc:711–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709Tensor::~Tensor() { UnrefIfNonNull(buf_); }
710
711void Tensor::CopyFromInternal(const Tensor& other, const TensorShape& shape) {
712 CHECK_EQ(shape.num_elements(), other.NumElements());
713 // Data type will be overwritten if this == &other, since dtype is part of
714 // shape.
715 DataType other_dtype = other.dtype();
716 shape_ = shape;
717 set_dtype(other_dtype);
718 if (buf_ != other.buf_) {
719 UnrefIfNonNull(buf_);
720 buf_ = other.buf_;
721 RefIfNonNull(buf_);
722 }
723}
724
725Status Tensor::BitcastFrom(const Tensor& other, DataType dtype,
726 const TensorShape& shape) {

Callers

nothing calls this directly

Calls 5

UnrefIfNonNullFunction · 0.85
RefIfNonNullFunction · 0.85
num_elementsMethod · 0.45
NumElementsMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected