我的应用无法在设备或模拟器上启动,并且出现此错误消息。按照说明,我已经在Xcode中启用了调试日志记录,但是仍然出现相同的错误,并且我的应用无法在启动时启动。这是我正在配置Firebase的AppDelegate.m类,如果在AppDelegate.m中对此行添加注释,则为[GeneratedPluginRegistrant registerWithRegistry:self];然后我的应用程序启动,我得到
MissingPluginException错误。
B
import torch
import numpy as np
def cov_complex(m_comp):
# (adding further parameters such as `y` is left for exercise)
# Supposing real and img are stored separately in the last dim:
real, img = m_comp[..., 0], m_comp[..., 1]
x_real = real - torch.mean(real, dim=1)[:, None]
x_img = img - torch.mean(img, dim=1)[:, None]
x_real_T = x_real.t()
x_img_T = x_img.t()
frac = 1 / (x_real.size(1) - 1)
cov_real = frac * (x_real.mm(x_real_T) + x_img.mm(x_img_T))
cov_img = frac * (-x_real.mm(x_img_T) + x_img.mm(x_real_T))
return torch.stack((cov_real, cov_img), dim=-1)
# Matrix with real/img values stored separately in last dimension:
M_np = np.random.rand(3, 2, 2)
# Same matrix converted to np.complex format:
M_comp_np = M_np.view(dtype=np.complex128)[...,0]
# Same matrix as torch.Tensor:
M = torch.from_numpy(M_np)
cov_com_np = np.cov(M_comp_np)
cov_com = cov_complex(M)
eq = np.allclose(cov_com_np, cov_com.numpy().view(dtype=np.complex128)[...,0])
print("Numpy & Torch complex covariance results equal? > {}".format(eq))
# Numpy & PyTorch complex covariance results equal? > True