Compiling C/C + + interface of TensorFlow
TensorFlow's Python interface is popular because of its convenience and practicability, but we may need other programming language interfaces in practical application. This article will introduce how to compile TensorFlow's C/C + + interface.Installation environment:Ubuntu 16.04Python 3.5CUDA 9.0cuDNN 7Bazel 0.17.2TensorFlow 1.11.0
1. Install ...
Posted by - - NC - - on Sun, 15 Dec 2019 08:49:31 -0800
LeetCode 234 - palindrome list
1. topic
Please judge whether a linked list is palindrome linked list.Example 1:Input: 1->2Output: falseExample 2:
Input: 1 - > 2 - > 2 - > 1Output: true
Advance:Can you use O(n) time complexity and O(1) space complexity to solve this problem?
2. way of thinking
This question can be regarded as Inverted list and Middle node of link ...
Posted by impressthenet on Sun, 15 Dec 2019 08:47:38 -0800
Fuzhou University algorithm assignment - addition operation
★ experimental task
In the final exam of the first grade of primary school, the teacher gave a question: give a row of numbers, select several consecutive numbers, and calculate their sum. The sum of these numbers is required to meet the conditions of a and b. Quickly count out the number of subsequences of students, you can get full marks! ...
Posted by designxperts on Sat, 14 Dec 2019 11:35:56 -0800
LeetCode 240 -- search two-dimensional matrix II
1. topic
2. answers
2.1. Method I
Compare from the bottom left corner of the matrix
Return true if the target value is equal to the current element;
If the target value is greater than the current element, increase j by 1 and search to the right to exclude the data above this column (all smaller than the current element);
If the target value ...
Posted by bestpricehost on Tue, 10 Dec 2019 19:32:45 -0800
Boost.Asio source reading: services and asynchronous operations
Based on Boost 1.69, this article cuts out some deprecated or different configured code blocks that are not related to the topic of this article when displaying the source code.
Service type
resolving service
socket/file operation
timer
...
service resolution
Here, take the reactive socket service that provides services around reactor as an e ...
Posted by phpforever on Tue, 10 Dec 2019 11:49:23 -0800
BZOJ4602: [Sdoi2016] gear (and look up heuristic combination)
meaning of the title
Title Link
Give a tree, each node has weight, select \ (k \) connecting blocks, maximize
\[\frac{\sum_{i \in S} a_i}{k}\]
Sol
It's very similar to cc
For the initial \ (N \) points, each additional restriction actually merges two connection blocks.
Then we preprocess \ (val[i] \) to indicate that the root node of the connec ...
Posted by gemmerz on Tue, 10 Dec 2019 09:44:34 -0800
Luogu P4590 [TJOI2018] garden party (dp LCS)
meaning of the title
Title Link
Sol
This question may be the only non template question of TJOI2018..
Considering the transfer equation of LCS,
\[f[i][j] = max(f[i - 1][j], f[i][j - 1], f[i - 1][j - 1] + (A_i = B_j))\]
That is to say, I f we know the previous column vector \ (f[i - 1] \) and \ (A_i, B_j \), we can transfer it
Then dp can be use ...
Posted by schris403 on Tue, 10 Dec 2019 07:26:49 -0800
[C + +] 37 μ intelligent pointer analysis
Eternal topic
Memory leak (infamous Bug)
Dynamic request heap space, do not return after use
There is no garbage collection mechanism in C + + language
Pointer cannot control the life cycle of the indicated heap space
Programming experiments: memory leaks
#include <iostream>
#include <string>
using namespace std;
class Test
{
...
Posted by kevinc on Tue, 10 Dec 2019 05:29:02 -0800
Construction and traversal of binary tree of data structure
Preface
Recently, I learned about binary trees. I learned to construct binary trees and tried three traversal operations. This time, we mainly use recursion. Later, we will sort out non recursion methods.
Define binary tree
1 typedef struct BinaryTree
2 {
3 TelemType data;
4 struct BinaryTree *lchild;
5 struct BinaryTree *rch ...
Posted by WinterDragon on Tue, 10 Dec 2019 01:16:32 -0800
The use of c/c + + multi thread unique lock
The use of multi thread unique lock
Features of unique lock:
1. Flexible. You can create an instance of unique_lock without locking, and then manually call the lock_a.lock() function, or std::lock(lock_a,...) ), to lock. When the instance of unique lock is destructed, the unlock function will be called automatically to release the lock.
unique_ ...
Posted by Robkid on Mon, 09 Dec 2019 22:46:02 -0800