/external/tensorflow/tensorflow/core/framework/ |
H A D | tensor_reference.cc | 20 TensorReference::TensorReference(const Tensor& tensor) argument 21 : buf_(tensor.buf_ ? tensor.buf_->root_buffer() : nullptr) {
|
H A D | tensor_util.cc | 19 #include "tensorflow/core/framework/tensor.h" 24 namespace tensor { namespace in namespace:tensorflow 32 // We use StringPiece as a convenient map over the tensor buffer, 53 for (const Tensor& tensor : tensors) { 54 if (tensor.dims() == 0) { 56 "Cannot concatenate a zero-dimensional tensor"); 58 total_dim0_size += tensor.dim_size(0); 72 // We use StringPiece as a convenient map over the tensor buffer, 79 for (const Tensor& tensor : tensors) { 80 StringPiece from_data = tensor 109 Split(const Tensor& tensor, const gtl::ArraySlice<int64>& sizes, std::vector<Tensor>* result) argument [all...] |
H A D | unique_tensor_references.cc | 26 for (auto& tensor : refs) { 27 tensor.Unref(); 33 void UniqueTensorReferences::Add(const Tensor& tensor) { argument 35 // Do nothing if the tensor has a null buffer. 36 if (tensor.IsInitialized() && tensor.NumElements() > 0) { 40 const TensorReference tensor_ref(tensor); 42 // The tensor was a duplicate, so discard the reference. 47 if (referenced_tensors_vector_[i].SharesBufferWith(tensor)) { 48 // tensor i [all...] |
/external/eigen/unsupported/test/ |
H A D | cxx11_tensor_custom_index.cpp | 24 Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7); 25 tensor.setRandom(); 36 VERIFY_IS_EQUAL(tensor.coeff(coeffC), tensor.coeff(coeff)); 37 VERIFY_IS_EQUAL(tensor.coeffRef(coeffC), tensor.coeffRef(coeff)); 46 Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7); 47 tensor.setRandom(); 54 VERIFY_IS_EQUAL(tensor.coeff(coeffC), tensor [all...] |
H A D | cxx11_tensor_argmax.cpp | 22 Tensor<float, 4, DataLayout> tensor(2,3,5,7); 23 tensor.setRandom(); 24 tensor = (tensor + tensor.constant(0.5)).log(); 27 index_tuples = tensor.index_tuples(); 32 VERIFY_IS_EQUAL(v.second, tensor.coeff(n)); 39 Tensor<float, 4, DataLayout> tensor(2,3,5,7); 40 tensor.setRandom(); 41 tensor [all...] |
H A D | cxx11_tensor_layout_swap.cpp | 18 Tensor<float, 3, ColMajor> tensor(2,3,7); 19 tensor.setRandom(); 21 Tensor<float, 3, RowMajor> tensor2 = tensor.swap_layout(); 22 VERIFY_IS_EQUAL(tensor.dimension(0), tensor2.dimension(2)); 23 VERIFY_IS_EQUAL(tensor.dimension(1), tensor2.dimension(1)); 24 VERIFY_IS_EQUAL(tensor.dimension(2), tensor2.dimension(0)); 29 VERIFY_IS_EQUAL(tensor(i,j,k), tensor2(k,j,i)); 38 Tensor<float, 3, ColMajor> tensor(2,3,7); 39 tensor.setRandom(); 42 tensor2.swap_layout() = tensor; [all...] |
H A D | cxx11_tensor_scan.cpp | 21 Tensor<Type, 1, DataLayout> tensor(size); 22 tensor.setRandom(); 23 Tensor<Type, 1, DataLayout> result = tensor.cumsum(0, Exclusive); 25 VERIFY_IS_EQUAL(tensor.dimension(0), result.dimension(0)); 31 accum += tensor(i); 33 accum += tensor(i); 39 result = tensor.cumprod(0, Exclusive); 43 accum *= tensor(i); 45 accum *= tensor(i); 55 Tensor<Type, 4, DataLayout> tensor(siz [all...] |
H A D | cxx11_tensor_io.cpp | 19 Tensor<int, 0, DataLayout> tensor; local 20 tensor() = 123; 23 os << tensor; local 33 Tensor<int, 1, DataLayout> tensor(5); 35 tensor(i) = i; 39 os << tensor; local 55 Tensor<int, 2, DataLayout> tensor(5, 3); 58 tensor(i, j) = i*j; 63 os << tensor; local 91 Tensor<std::string, 2, DataLayout> tensor( 97 os << tensor; local [all...] |
/external/libtextclassifier/ |
H A D | tensor-view_test.cc | 17 #include "tensor-view.h" 27 const TensorView<float> tensor(data.data(), {3, 1, 2}); 28 EXPECT_TRUE(tensor.is_valid()); 29 EXPECT_EQ(tensor.shape(), (std::vector<int>{3, 1, 2})); 30 EXPECT_EQ(tensor.data(), data.data()); 31 EXPECT_EQ(tensor.size(), 6); 32 EXPECT_EQ(tensor.dims(), 3); 33 EXPECT_EQ(tensor.dim(0), 3); 34 EXPECT_EQ(tensor.dim(1), 1); 35 EXPECT_EQ(tensor [all...] |
/external/tensorflow/tensorflow/contrib/slim/python/slim/ |
H A D | summaries.py | 42 def _get_summary_name(tensor, name=None, prefix=None, postfix=None): 46 tensor: A variable or op `Tensor`. 55 name = tensor.op.name 63 def add_histogram_summary(tensor, name=None, prefix=None): 64 """Adds a histogram summary for the given tensor. 67 tensor: A variable or op tensor. 76 _get_summary_name(tensor, name, prefix), tensor) 79 def add_image_summary(tensor, nam [all...] |
/external/tensorflow/tensorflow/python/eager/ |
H A D | pywrap_tensor.h | 23 tensorflow::int64 EagerTensor_id(const PyObject* tensor);
|
/external/tensorflow/tensorflow/contrib/lite/ |
H A D | context.c | 70 const void* allocation, TfLiteTensor* tensor) { 71 TfLiteTensorFree(tensor); 72 tensor->type = type; 73 tensor->name = name; 74 tensor->dims = dims; 75 tensor->params = quantization; 76 tensor->data.raw = buffer; 77 tensor->bytes = size; 78 tensor->allocation_type = allocation_type; 79 tensor 67 TfLiteTensorReset(TfLiteType type, const char* name, TfLiteIntArray* dims, TfLiteQuantizationParams quantization, char* buffer, size_t size, TfLiteAllocationType allocation_type, const void* allocation, TfLiteTensor* tensor) argument 82 TfLiteTensorRealloc(size_t num_bytes, TfLiteTensor* tensor) argument [all...] |
/external/tensorflow/tensorflow/contrib/gan/python/features/python/ |
H A D | conditioning_utils_impl.py | 40 def _get_shape(tensor): 41 tensor_shape = array_ops.shape(tensor) 47 def condition_tensor(tensor, conditioning): 48 """Condition the value of a tensor. 53 tensor: A minibatch tensor to be conditioned. 55 dimension the same as `tensor`. 58 `tensor` conditioned on `conditioning`. 61 ValueError: If the non-batch dimensions of `tensor` aren't fully defined. 65 tensor [all...] |
/external/eigen/unsupported/Eigen/CXX11/src/Tensor/ |
H A D | TensorIO.h | 17 // Print the tensor as a 2d matrix 20 static void run (std::ostream& os, const Tensor& tensor) { argument 23 const Index total_size = internal::array_prod(tensor.dimensions()); 25 const Index first_dim = Eigen::internal::array_get<0>(tensor.dimensions()); 27 Map<const Array<Scalar, Dynamic, Dynamic, layout> > matrix(const_cast<Scalar*>(tensor.data()), first_dim, total_size/first_dim); 34 // Print the tensor as a vector 37 static void run (std::ostream& os, const Tensor& tensor) { argument 40 const Index total_size = internal::array_prod(tensor.dimensions()); 42 Map<const Array<Scalar, Dynamic, 1> > array(const_cast<Scalar*>(tensor.data()), total_size); 49 // Print the tensor a 52 run(std::ostream& os, const Tensor& tensor) argument [all...] |
/external/tensorflow/tensorflow/python/framework/ |
H A D | subscribe.py | 105 def _subscribe_new(tensor, side_effects, control_cache): 106 """Helper method that subscribes a single tensor to a list of side_effects. 109 tensor: `tf.Tensor` 113 The modified replacement to the passed in tensor which triggers the side 117 for consumer_op in list(tensor.consumers()): # explicit copy 118 update_input.append((consumer_op, list(consumer_op.inputs).index(tensor))) 120 update_control_input = control_cache.get_control_outputs(tensor.op) 123 name_scope = tensor.op.name + '/subscription/' 127 outs += s(tensor) 130 out = array_ops.identity(tensor) [all...] |
/external/tensorflow/tensorflow/python/summary/ |
H A D | text_summary.py | 18 string-type tensor and emits a TensorSummary op with SummaryMetadata that 35 def text_summary(name, tensor, collections=None): 41 If a tensor with more than 2 dimensions is provided, a 2d subarray will be 49 tensor: a string-type Tensor to summarize. 59 ValueError: If tensor has the wrong type. 61 if tensor.dtype != dtypes.string: 62 raise ValueError("Expected tensor %s to have dtype string, got %s" % 63 (tensor.name, tensor.dtype)) 70 tensor [all...] |
/external/tensorflow/tensorflow/contrib/lite/kernels/internal/ |
H A D | tensor.h | 25 inline T* GetTensorData(TfLiteTensor* tensor); 28 inline float* GetTensorData(TfLiteTensor* tensor) { argument 29 return tensor != nullptr ? tensor->data.f : nullptr; 33 inline uint8_t* GetTensorData(TfLiteTensor* tensor) { argument 34 return tensor != nullptr ? tensor->data.uint8 : nullptr; 38 inline int32_t* GetTensorData(TfLiteTensor* tensor) { argument 39 return tensor != nullptr ? tensor 43 GetTensorData(TfLiteTensor* tensor) argument 75 GetTensorDims(const TfLiteTensor* tensor) argument [all...] |
/external/tensorflow/tensorflow/contrib/lite/testing/ |
H A D | tflite_driver.cc | 26 // Returns the value in the given position in a tensor. 68 bool Check(bool verbose, const TfLiteTensor& tensor) { argument 69 switch (tensor.type) { 71 return TypedCheck<float>(verbose, tensor); 73 return TypedCheck<int32_t>(verbose, tensor); 75 return TypedCheck<int64_t>(verbose, tensor); 77 return TypedCheck<uint8_t>(verbose, tensor); 79 fprintf(stderr, "Unsupported type %d in Check\n", tensor.type); 86 bool TypedCheck(bool verbose, const TfLiteTensor& tensor) { argument 91 int tensor_size = tensor 243 auto* tensor = interpreter_->tensor(id); local [all...] |
/external/tensorflow/tensorflow/contrib/layers/python/layers/ |
H A D | summaries.py | 43 def _add_scalar_summary(tensor, tag=None): 44 """Add a scalar summary operation for the tensor. 47 tensor: The tensor to summarize. 48 tag: The tag to use, if None then use tensor's op's name. 56 tensor.get_shape().assert_has_rank(0) 57 tag = tag or '%s_summary' % tensor.op.name 58 return summary.scalar(tag, tensor) 61 def _add_histogram_summary(tensor, tag=None): 62 """Add a summary operation for the histogram of a tensor [all...] |
/external/tensorflow/tensorflow/contrib/lite/toco/tensorflow_graph_matching/ |
H A D | cluster_utils.cc | 23 void Transpose2DTensor(const float* tensor, int row, int col, argument 28 *(result + c * row) = *tensor++;
|
/external/tensorflow/tensorflow/python/kernel_tests/ |
H A D | tensor_priority_test.py | 38 tensor = ops.convert_to_tensor([[10.0, 20.0]]) variable in class:TensorPriorityTest.testSupportedRhsWithoutDelegation.NumpyArraySubclass 39 res = tensor + rhs 47 tensor = ops.convert_to_tensor([[10.0, 20.0]]) 52 tensor + rhs 61 tensor = ops.convert_to_tensor([[10.0, 20.0]]) 63 res = tensor + rhs 79 tensor = ops.convert_to_tensor([[10.0, 20.0]]) 81 res = tensor + rhs
|
/external/tensorflow/tensorflow/python/lib/core/ |
H A D | safe_ptr.cc | 24 Safe_TF_TensorPtr make_safe(TF_Tensor* tensor) { argument 25 return Safe_TF_TensorPtr(tensor);
|
/external/tensorflow/tensorflow/python/saved_model/ |
H A D | utils_impl.py | 32 def build_tensor_info(tensor): 36 tensor: Tensor or SparseTensor whose name, dtype and shape are used to 44 dtype=dtypes.as_dtype(tensor.dtype).as_datatype_enum, 45 tensor_shape=tensor.get_shape().as_proto()) 46 if isinstance(tensor, sparse_tensor.SparseTensor): 47 tensor_info.coo_sparse.values_tensor_name = tensor.values.name 48 tensor_info.coo_sparse.indices_tensor_name = tensor.indices.name 49 tensor_info.coo_sparse.dense_shape_tensor_name = tensor.dense_shape.name 51 tensor_info.name = tensor.name 70 KeyError: If `tensor_info` does not correspond to a tensor i [all...] |
/external/tensorflow/tensorflow/contrib/lite/java/src/test/java/org/tensorflow/lite/ |
H A D | TensorTest.java | 56 Tensor tensor = Tensor.fromHandle(nativeHandle); 57 assertThat(tensor).isNotNull(); 59 assertThat(tensor.shapeCopy).isEqualTo(expectedShape); 60 assertThat(tensor.dtype).isEqualTo(DataType.FLOAT32); 65 Tensor tensor = Tensor.fromHandle(nativeHandle); 67 tensor.copyTo(parsedOutputs); 75 Tensor tensor = Tensor.fromHandle(nativeHandle); 78 tensor.copyTo(parsedOutputs); 84 "Cannot convert an TensorFlowLite tensor with type " 92 Tensor tensor [all...] |
/external/tensorflow/tensorflow/core/kernels/ |
H A D | training_op_helpers.h | 33 // This is for use with ResourceVariables to ensure *tensor has a 35 // REQUIRES: If you pass in variable->tensor(), *variable->mu() must be held. 37 Status PrepareToUpdateVariable(OpKernelContext* ctx, Tensor* tensor) { argument 38 if (!tensor->RefCountIsOne()) { 47 tensor->dtype(), tensor->shape(), &unused, &tmp, attr)); 50 const_cast<const Tensor*>(tensor)->flat<T>()); 51 *tensor = *tmp; 56 // This gives you `*out`, a tensor you can update, corresponding to a 71 PrepareToUpdateVariable<Device, T>(ctx, var->tensor())); [all...] |