C++ name mangling decoder
>>> import cxxfilt
>>> cxxfilt.demangle(‘N5Eigen9TensorMapINS_6TensorIfLi2ELi1ElEELi16ENS_11MakePointerEEE‘, external_only=False)
u‘Eigen::TensorMap<Eigen::Tensor<float, 2, 1, long>, 16, Eigen::MakePointer>‘
矩阵内积
>>> import numpy as np
>>> a="0.239037 0.9204 0.0505124 0.495744 0.835522 0.0264704 0.0881131 0.45666 0.768839 0.737636 0.785049 0.312026 0.151865 0.202761 0.308386 0.540147 0.190109 0.312229"
>>> b="0.147634 0.51363 -0.320737 -0.371638 0.454611 -0.0921967 -0.17918 0.285891 -0.524478 -0.351671 -0.261996 -0.116514 0.00484961 0.0893065 -0.0380138 -0.506094 -0.382989 -0.493418 -0.168363 -0.367958 -0.489307 -0.524898 -0.336947 0.18723 0.192757 -0.292076 -0.0376495 -0.412302 0.194469 -0.343819 0.0158266 -0.458056 0.547083 0.137791 -0.508579 -0.224238"
>>> ma=np.array(a.split(), dtype=float).reshape(1,18)
>>> mb=np.array(b.split(), dtype=float).reshape(2,18)
>>> print(np.dot(ma,mb.T)) # mb这里需要转置一下
[[-0.59803179 -1.3585295 ]]
原文:https://www.cnblogs.com/coffee-code/p/12143918.html