在pytorch 上,在 Windows 10、conda 和 Cuda 9.0 上安装。
当我运行时 cmd 没有抱怨conda install pytorch cuda90 -c pytorch,然后当我运行时pip3 install torchvision我收到此错误消息。
Requirement already satisfied: torchvision in PATHTOFILE\python35\lib\site-packages (0.2.1)
Requirement already satisfied: numpy in PATHTOFILE\python35\lib\site-packages (from torchvision) (1.12.0+mkl)
Requirement already satisfied: six in PATHTOFILE\python35\lib\site-packages (from torchvision) (1.10.0)
Collecting pillow>=4.1.1 (from torchvision)
Using cached https://files.pythonhosted.org/packages/ab/d2/d27a21bd3e64db1ca1dc7dc16026a16d77f5c3ffca9ec619eddeea7c47ce/Pillow-5.1.0-cp35-cp35m-win_amd64.whl
Collecting torch (from torchvision)
Using cached https://files.pythonhosted.org/packages/5f/e9/bac4204fe9cb1a002ec6140b47f51affda1655379fe302a1caef421f9846/torch-0.1.2.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in …Run Code Online (Sandbox Code Playgroud) React遵循这个例子。
我希望能够将状态提升两个级别。意思是,当事件发生在较低级别的组件时,我希望它影响两个级别的状态。我该怎么做?这甚至推荐吗?
例如,组件 A 是组件 B 的父级,组件 B 是组件 C 的父级。A -> B -> C。
在一个,
handleChange = (e) => {console.log(e)}
<B onChange={handleChange}/>
Run Code Online (Sandbox Code Playgroud)
在 B 中,
handleChange = (e) => this.props.onChange(e)
<C onChange={this.handleChange}/>
Run Code Online (Sandbox Code Playgroud)
在 C 中,
handleChange = (e) => this.props.onChange(e)
<button onClick={this.handleChange}></button>
Run Code Online (Sandbox Code Playgroud)
有一个更好的方法吗?