python
guguai56
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Tensorflow复用计算图 reuse=tf.AUTO_REUSE
假设有一个场景, 一个结算的函数用于账单的计算, 需要对物品收取5%的税额和10元的运费. 在计算图中我们可以定义以下: def add_tax_and_shipping(price): """Add tax and shipping """ with tf.variable_scope("other_charge") as scope: tax = tf.get_variable("tax", (), dtype=tf.float32,原创 2020-05-09 17:16:42 · 4737 阅读 · 0 评论 -
tf 自定义op 编译
nvcc = /usr/local/cuda-10.1/bin/nvcc cudalib = /usr/local/cuda-10.1/lib64/ tensorflow = /home/wai/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/include tflag = -L/home/wai/anaconda3/envs/...原创 2019-12-27 16:04:34 · 1401 阅读 · 1 评论 -
Python __file__和目录
__file__ 直接在目录里面执行,结果显示当前文件(在Pycharm中会显示绝对路径) , 此变量在ipython中不可用 os.path.dirname():去掉脚本的文件名,返回目录。 os.path.dirname(os,path.realname(file)):指的是,获得你刚才所引用的模块 所在的绝对路径,file__为内置属性。 用__file 来获得脚本所在的路径是比较方便的,...原创 2019-10-22 11:37:35 · 1621 阅读 · 0 评论
分享