tensorflow2使用vscode没有参数提示悬浮窗的解决办法

在尝试使用vscode写tensorflow代码时,发现无法对tf.keras下的代码进行提示,不会产生参数提示的悬浮窗

实际效果

在这里插入图片描述

期望效果在这里插入图片描述

随后翻阅tensorflow,github的issue下发现答案,
在这里插入图片描述

在这里插入图片描述

解决方法

在tensorflow2.2正式版暂没有发布的前提下,使用pip install tf-nightly-gpu安装tensorflow的最新测试版本,进行暂时替代。更换tensorflow版本后,发现问题解决

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
下面是一个使用ES6实现动态悬浮组件的示例代码: ```javascript class FloatWindow { constructor({ width, height, backgroundColor }) { this.width = width || 200; this.height = height || 200; this.backgroundColor = backgroundColor || '#FFF'; this.isDragging = false; this.mouseOffsetX = 0; this.mouseOffsetY = 0; this.element = this.createFloatWindow(); this.addEventListeners(); } createFloatWindow() { const floatWindow = document.createElement('div'); floatWindow.style.position = 'absolute'; floatWindow.style.width = `${this.width}px`; floatWindow.style.height = `${this.height}px`; floatWindow.style.backgroundColor = this.backgroundColor; return floatWindow; } addEventListeners() { this.element.addEventListener('mousedown', (event) => { this.isDragging = true; this.mouseOffsetX = event.clientX - this.element.offsetLeft; this.mouseOffsetY = event.clientY - this.element.offsetTop; }); document.addEventListener('mousemove', (event) => { if (this.isDragging) { this.element.style.left = `${event.clientX - this.mouseOffsetX}px`; this.element.style.top = `${event.clientY - this.mouseOffsetY}px`; } }); document.addEventListener('mouseup', () => { this.isDragging = false; }); } show() { document.body.appendChild(this.element); } hide() { document.body.removeChild(this.element); } } ``` 使用该组件时,可以通过传入一个配置对象来设置悬浮的大小和背景颜色: ```javascript const floatWindow = new FloatWindow({ width: 300, height: 300, backgroundColor: 'lightblue' }); floatWindow.show(); ``` 然后调用`show()`方法即可在页面中显示悬浮,调用`hide()`方法可以将悬浮从页面中移除。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值