我一直在关注这里提供的说明: https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x
但是,当我尝试运行时,我一直收到错误"
sudo apt-get install dotnet-sdk-2.1.4
Run Code Online (Sandbox Code Playgroud)
具体来说它说:
E:无法找到包dotnet-sdk-2.1.4
E:找不到任何包'glob'netnet-sdk-2.1.4'E
:找不到任何包由regex'netnet-sdk-2.1.4 "
但是,sudo apt search dotnet
在包中显示结果.
难道我做错了什么?
我试图在单元测试中模拟一个实用程序类(在本例中为python logger实用程序).
虽然我知道如何在每个测试级别上使用monkeypatch来实现它,但我希望我能够以某种方式简单地将其作为setup/global的一部分.
这是我希望我能做的(但我得到错误):
import logging
...
def setup(self, monkeypatch):
class fake_logger(level):
def __init__(self, val):
pass
def setLevel(self, level):
# Do something
def mock_logger(level):
return fake_logger(level)
monkeypatch.setattr(logging, 'getLogger', mock_logger)
Run Code Online (Sandbox Code Playgroud)
这样做的正确方法是什么?
编辑:示例错误
name = 'setup'
def call_optional(obj, name):
method = getattr(obj, name, None)
isfixture = hasattr(method, "_pytestfixturefunction")
if method is not None and not isfixture and py.builtin.callable(method):
# If there's any problems allow the exception to raise rather than
# silently ignoring them
> method()
E TypeError: setup() missing 1 required …
Run Code Online (Sandbox Code Playgroud) 随着最新版本的Tensor Flow现在在Windows上,我试图尽可能高效地运行一切.但是,即使从源代码编译,我仍然无法弄清楚如何启用SSE和AVX指令.
默认进程:https: //github.com/tensorflow/tensorflow/tree/r0.12/tensorflow/contrib/cmake 没有提到如何执行此操作.
我发现的唯一参考是使用Google的Bazel: 如何使用SSE4.2和AVX指令编译Tensorflow?
有没有人知道使用MSBuild打开这些高级指令的简单方法?我听说他们至少加速了3倍.
为了帮助那些寻找类似解决方案的人,这是我目前得到的警告:https: //github.com/tensorflow/tensorflow/tree/r0.12/tensorflow/contrib/cmake
我在64位平台上使用Windows 10 Professional,Visual Studio 2015社区版,带有cmake版本3.6.3的Anaconda Python 3.6(更高版本不适用于Tensor Flow)
任何帮助赞赏!