import tensorflow as tf
x=tf.constant([-0.2,0.5,43.98,-23.1,26.58])
y=tf.clip_by_value(x,1e-10,1.0)
sess=tf.Session()
print sess.run(y)

sess.close()

clip_by_value(
    t,
    clip_value_min,
    clip_value_max,
    name=None
)

Given a tensor t, this operation returns a tensor of the same type and shape as t with its values clipped to clip_value_min and clip_value_max. Any values less than clip_value_min are set to clip_value_min. Any values greater than clip_value_max are set to clip_value_max.

Args:

  • t: A Tensor.
  • clip_value_min: A 0-D (scalar) Tensor, or a Tensor with the same shape as t. The minimum value to clip by.
  • clip_value_max: A 0-D (scalar) Tensor, or a Tensor with the same shape as t. The maximum value to clip by.
  • name: A name for the operation (optional).

Returns:

A clipped Tensor.

最新文章

  1. xUnit安装及注意事项
  2. C#将字节流加密解密
  3. Centos单网卡配置多个IP的方法
  4. poj 1840 暴力+标记
  5. zoj 2706 线段树
  6. weka打开提示内存不足的解决方法
  7. CodeForces 631D Messenger
  8. 基于redis实现tomcat8及以上版本的tomcat集群的session持久化实现(tomcat-redis-session-manager二次开发)
  9. egametang网络系统组件
  10. 《SQL必知必会》读书笔记
  11. bash: scrapy: command not found
  12. CSS 圣杯布局 / 双飞翼布局的实现
  13. Upload a file with $.ajax to AWS S3 with a pre-signed url
  14. tedu训练营day04
  15. 使用 Charles 抓取 App 网络请求
  16. GCC卡常
  17. C++实现景区信息管理系统
  18. 安装Docker和配置加速器(二)
  19. MySQL5.5登录密码忘记了,怎嘛办?
  20. redis实现消息队列(七)

热门文章

  1. Python函数之初体验
  2. CodeForces - 995E Number Clicker (双向BFS)
  3. 设计模式(三) cglib代理
  4. 剑指offer编程题66道题 36-66
  5. RegExp方法解析
  6. 深入理解PHP之:Nginx 与 FPM 的工作机制
  7. PHP面向对象程序设计之接口(interface)
  8. CentOS6、7优化脚本完美版
  9. Mysql导出导入数据库
  10. JAVA文件下载,页面显示另存为效果