Home
last modified time | relevance | path

Searched refs:tensor_ (Results 1 – 25 of 28) sorted by relevance

12

/external/tensorflow/tensorflow/lite/experimental/resource/
Dresource_variable.cc27 memset(&tensor_, 0, sizeof(TfLiteTensor)); in ResourceVariable()
31 tensor_ = other.tensor_; in ResourceVariable()
34 memset(&other.tensor_, 0, sizeof(TfLiteTensor)); in ResourceVariable()
40 free(tensor_.data.raw); in ~ResourceVariable()
41 if (tensor_.dims) { in ~ResourceVariable()
42 TfLiteIntArrayFree(tensor_.dims); in ~ResourceVariable()
49 char* old_raw = tensor_.data.raw; in AssignFrom()
50 size_t old_bytes = tensor_.bytes; in AssignFrom()
51 TfLiteIntArray* old_dims = tensor_.dims; in AssignFrom()
54 memset(&tensor_, 0, sizeof(tensor_)); in AssignFrom()
[all …]
Dresource_variable.h47 TfLiteTensor* GetTensor() { return is_initialized_ ? &tensor_ : nullptr; } in GetTensor()
55 TfLiteTensor tensor_;
/external/tensorflow/tensorflow/cc/experimental/base/public/
Dtensor.h101 explicit Tensor(TF_Tensor* tensor) : tensor_(tensor) {} in Tensor()
109 TF_Tensor* GetTFTensor() const { return tensor_.get(); } in GetTFTensor()
124 std::unique_ptr<TF_Tensor, TFTensorDeleter> tensor_; variable
127 inline void* Tensor::data() const { return TF_TensorData(tensor_.get()); } in data()
129 inline int Tensor::dims() const { return TF_NumDims(tensor_.get()); } in dims()
132 return TF_Dim(tensor_.get(), d); in dim_size()
136 return TF_TensorType(tensor_.get()); in dtype()
140 return TF_TensorElementCount(tensor_.get()); in num_elements()
144 return TF_TensorByteSize(tensor_.get()); in num_bytes()
/external/tensorflow/tensorflow/core/common_runtime/eager/
Dtensor_handle_data.cc28 *t = &tensor_; in Tensor()
36 tensorflow::Tensor& tensor = tensor_; in TensorValue()
45 *shape = tensor_.shape(); in Shape()
53 *num_dims = tensor_.dims(); in NumDims()
61 *dim = tensor_.dim_size(dim_index); in Dim()
69 *num_elements = tensor_.NumElements(); in NumElements()
87 tensor_ = std::move(t); in SetTensor()
89 forwarding_protection_tensor_ = tensor_; in SetTensor()
99 return tensor_.DeviceSafeDebugString(); in DebugString()
Dtensor_handle_data.h30 : tensor_(std::move(t)), in LocalTensorHandleData()
31 forwarding_protection_tensor_(tensor_), in LocalTensorHandleData()
63 tensorflow::Tensor tensor_;
/external/tensorflow/tensorflow/core/profiler/internal/
Dtfprof_tensor.cc39 tfprof_tensor_pb_.set_dtype(tensor_->dtype()); in Build()
41 switch (tensor_->dtype()) { in Build()
46 if (tensor_->dtype() == DataType::DT_FLOAT) { in Build()
48 } else if (tensor_->dtype() == DataType::DT_DOUBLE) { in Build()
58 if (tensor_->dtype() == DataType::DT_INT32) { in Build()
60 } else if (tensor_->dtype() == DataType::DT_INT64) { in Build()
74 absl::FPrintF(stderr, "Not Supported type %d\n", tensor_->dtype()); in Build()
Dtfprof_tensor.h39 : tensor_(std::move(tensor)) { in TFProfTensor()
87 if (tensor_->dims() == 0 && values.size() == 1) { in BuildOutput()
111 for (int i = 0; i < tensor_->dim_size(depth); i++) { in BuildOutput()
113 if (depth == tensor_->dims() - 1) { in BuildOutput()
156 if (tensor_->NumElements() > kTFProfTensorMaxWarnLen) { in GetValueVec()
159 auto values = tensor_->flat<T>(); in GetValueVec()
160 for (int64 i = 0; i < tensor_->NumElements(); i++) { in GetValueVec()
166 std::unique_ptr<Tensor> tensor_; variable
/external/tensorflow/tensorflow/c/
Dtf_tensor.cc191 TensorBuffer* buf = tensorflow::TensorCApi::Buffer(tensor_); in CanMove()
199 DataType TensorInterface::Type() const { return tensor_.dtype(); } in Type()
201 int TensorInterface::NumDims() const { return tensor_.dims(); } in NumDims()
204 return static_cast<int64_t>(tensor_.dim_size(dim_index)); in Dim()
208 return static_cast<int64_t>(tensor_.NumElements()); in NumElements()
212 return tensorflow::TensorCApi::Buffer(tensor_)->size(); in ByteSize()
216 return tensorflow::TensorCApi::Buffer(tensor_)->data(); in Data()
225 return tensor_.BitcastFrom(from.tensor_, type, s); in BitcastFrom()
300 if (tensor_.dtype() == DT_RESOURCE) { in ToTensor()
301 if (tensor_.dims() != 0) { in ToTensor()
[all …]
Dtf_tensor_internal.h94 explicit TensorInterface(tensorflow::Tensor t) : tensor_(std::move(t)) {} in TensorInterface()
112 tensorflow::Tensor& Tensor() { return tensor_; } in Tensor()
115 tensorflow::Tensor tensor_;
/external/tensorflow/tensorflow/core/kernels/
Dhost_constant_op.cc28 : OpKernel(ctx), tensor_(ctx->output_type(0)) { in _HostConstantOp()
34 ctx, ctx->device()->MakeTensorFromProto(*proto, alloc_attr, &tensor_)); in _HostConstantOp()
36 ctx, ctx->output_type(0) == tensor_.dtype(), in _HostConstantOp()
38 DataTypeString(tensor_.dtype()), ") and dtype (", in _HostConstantOp()
43 ctx->set_output(0, tensor_); in Compute()
Dsparse_cross_op.cc175 explicit DenseTensorColumn(const Tensor& tensor) : tensor_(tensor) {} in DenseTensorColumn()
177 int64 FeatureCount(int64 batch) const override { return tensor_.dim_size(1); } in FeatureCount()
184 const Tensor& tensor_; member in tensorflow::__anon01cd01200111::DenseTensorColumn
192 : tensor_(tensor) { in KeyedDenseTensorColumn()
196 int64 FeatureCount(int64 batch) const override { return tensor_.dim_size(1); } in FeatureCount()
203 const Tensor& tensor_; member in tensorflow::__anon01cd01200111::KeyedDenseTensorColumn
211 if (DT_STRING == tensor_.dtype()) in Feature()
212 return Fingerprint64(tensor_.matrix<tstring>()(batch, n)); in Feature()
213 return tensor_.matrix<int64>()(batch, n); in Feature()
220 if (DT_STRING == tensor_.dtype()) { in Feature()
[all …]
Dvariable_ops.cc48 explicit LegacyVar(DataType dtype) : tensor_(dtype) {} in LegacyVar()
54 Tensor* tensor() { return &tensor_; } in tensor()
57 return strings::StrCat(DataTypeString(tensor_.dtype()), "/", in DebugString()
58 tensor_.shape().DebugString()); in DebugString()
63 Tensor tensor_; member in tensorflow::LegacyVar
Dhost_constant_op.h33 const Tensor* const_tensor() const override { return &tensor_; }; in const_tensor()
37 Tensor tensor_;
Dconstant_op.h32 const Tensor* const_tensor() const override { return &tensor_; }; in const_tensor()
36 Tensor tensor_;
Dconstant_op.cc74 tensor_(ctx->output_type(0)) { in ConstantOp()
79 *proto, AllocatorAttributes(), &tensor_)); in ConstantOp()
81 ctx, ctx->output_type(0) == tensor_.dtype(), in ConstantOp()
83 DataTypeString(tensor_.dtype()), ") and dtype (", in ConstantOp()
88 ctx->set_output(0, tensor_); in Compute()
90 ctx->record_persistent_memory_allocation(tensor_.AllocatedBytes()); in Compute()
/external/tensorflow/tensorflow/core/framework/
Dresource_var.h62 explicit Var(DataType dtype) : tensor_(dtype) {} in Var()
68 Tensor* tensor() { return &tensor_; } in tensor()
71 return strings::StrCat(DataTypeString(tensor_.dtype()), "/", in DebugString()
72 tensor_.shape().DebugString()); in DebugString()
92 Tensor tensor_; variable
Dop_kernel.h238 explicit PersistentTensor(const Tensor& tensor) : tensor_(tensor) {} in PersistentTensor()
247 bool IsInitialized() const { return tensor_.IsInitialized(); } in IsInitialized()
249 int64 NumElements() const { return tensor_.NumElements(); } in NumElements()
251 int64 AllocatedBytes() const { return tensor_.AllocatedBytes(); } in AllocatedBytes()
254 Tensor tensor_;
/external/tensorflow/tensorflow/core/distributed_runtime/
Dtensor_coding.cc39 tensor_ = Tensor(); in ClearTensor()
57 if (!tensor_.FromProto(allocator_, meta_.tensor())) { in InitFrom()
61 s = device_->MakeTensorFromProto(meta_.tensor(), alloc_attrs_, &tensor_); in InitFrom()
79 tensor_ = std::move(t); in InitPartial()
92 device_->MakeTensorFromProto(meta_.tensor(), alloc_attrs_, &tensor_); in ParseFrom()
160 tensor_ = std::move(t); in ParseTensorSubmessage()
207 tensor_ = std::move(t); in ParseTensorSubmessage()
289 tensor_ = std::move(parsed); in ParseSlow()
Dtensor_coding.h84 const Tensor& tensor() const { return tensor_; } in tensor()
105 Tensor tensor_; variable
/external/tensorflow/tensorflow/core/common_runtime/
Dring_reducer_test.cc333 Tensor* inst = &instances_[di]->tensor_; in RunTest()
457 tensor_ = in InitTensor()
460 init_f(&tensor_); in InitTensor()
467 ->CopyCPUTensorToDeviceSync(&cpu_tensor, device_, &tensor_) in InitTensor()
488 inputs.push_back(TensorValue(&tensor_)); in DoReduce()
507 *col_params_, &tensor_, DEVICE_CPU, device_); in DoReduce()
514 TF_CHECK_OK(ctx.forward_input_or_allocate_output({0}, 0, tensor_.shape(), in DoReduce()
526 kStepId, &tensor_, &tensor_); in DoReduce()
532 CHECK(tensor_.CopyFrom(*ctx.mutable_output(0), tensor_.shape())); in DoReduce()
538 const Tensor& tensor() { return tensor_; } in tensor()
[all …]
Dhierarchical_tree_broadcaster_test.cc446 const Tensor* t = &instances_[broadcast_dev_id]->tensor_; in RunTest()
474 Tensor* inst = &instances_[di]->tensor_; in RunTest()
612 tensor_ = in InitTensor()
615 f(&tensor_); in InitTensor()
623 &cpu_tensor, device_, &tensor_)); in InitTensor()
636 inputs.push_back(TensorValue(&tensor_)); in DoBroadcast()
659 ? parent_->GetCollectiveBcastSend(*col_params_, &tensor_, in DoBroadcast()
661 : parent_->GetCollectiveBcastRecv(*col_params_, tensor_.shape(), in DoBroadcast()
669 {0}, 0, tensor_.shape(), &output_tensor_ptr)); in DoBroadcast()
672 ctx.allocate_output(0, tensor_.shape(), &output_tensor_ptr)); in DoBroadcast()
[all …]
/external/tensorflow/tensorflow/stream_executor/
Ddnn.cc273 tensor_.mutable_dimensions()->Resize(ndims + 2, 0); in BatchDescriptor()
308 tensor_ = other.tensor_; in CloneFrom()
407 TensorDescriptorProto ret = tensor_; in ToProto()
415 tensor_.mutable_dimensions()->Resize(ndims + 2, 0); in FilterDescriptor()
424 tensor_ = other.tensor_; in CloneFrom()
479 TensorDescriptorProto ret = tensor_; in ToProto()
Ddnn.h250 int64 count() const { return tensor_.dimensions(0); } in count()
251 int64 feature_map_count() const { return tensor_.dimensions(1); } in feature_map_count()
258 DataLayout layout() const { return tensor_.data_layout(); } in layout()
272 tensor_.set_dimensions(0, value); in set_count()
276 tensor_.set_dimensions(1, value); in set_feature_map_count()
300 tensor_.set_data_layout(layout); in set_layout()
340 return AsInt64Slice(tensor_.dimensions()).subspan(2); in spatial_size()
344 return AsInt64Slice(tensor_.mutable_dimensions()).subspan(2); in spatial_size()
347 TensorDescriptorProto tensor_; variable
392 tensor_.set_dimensions(0, value); in set_output_feature_map_count()
[all …]
/external/tensorflow/tensorflow/cc/framework/
Dops.h214 tensor_(init.tensor) {}
218 tensor_(t) {}
228 tensor_ = Initializer(init).tensor;
241 const Tensor& tensor() const { return tensor_; }
246 Tensor tensor_;
/external/tensorflow/tensorflow/compiler/tf2tensorrt/convert/
Dconvert_nodes.h183 const Tensor& GetTensor() const { return tensor_; } in GetTensor()
188 return const_cast<char*>(tensor_.tensor_data().data()); in GetValues()
203 return absl::Span<const T>(tensor_.flat<T>().data(), count()); in GetSpan()
229 Tensor tensor_; variable
328 nvinfer1::ITensor* tensor_ = nullptr; // Not owned. variable

12