如何在Polymer 3元素中使用Polymer 2元素?以下不起作用,因为<link>元素在阴影dom中不起作用.
static get template() {
return '
<link rel="import" href="...">
<my-element></my-element>';
}
Run Code Online (Sandbox Code Playgroud)
我们可以简单地从<link>元素之外取出并放在顶层,但这感觉就像打破组件一样.
据我了解,tensorflow.contrib 已在 TF 2.0 API 中删除。TF 1.0 API 中 tensorflow.contrib.graph_editor 的新 2.0 替代品是什么?https://www.tensorflow.org/api_docs/python/tf/contrib/graph_editor
下面是一个人为的例子,它演示了效果并且必须以 root 运行。它在后台执行 ping 进程并试图杀死它。
#!/bin/bash
# Ensure that there is no ping process before we begin.
killall ping
sudo ping google.com > /dev/null &
PID=$!
sleep 0.5
kill $PID
echo "Exit code of kill $PID: $?"
# Check the running ping processes. There should be no ping
# process if the above `kill $PID` worked correctly.
ps aux | grep -v grep | grep ping
Run Code Online (Sandbox Code Playgroud)
但是,即使kill的返回码为 0 ,脚本也无法终止进程。以下是示例输出。
$ bash test.sh
Exit code of kill 16516: 0 …Run Code Online (Sandbox Code Playgroud)