Skip to content

Instantly share code, notes, and snippets.

@Strateus
Strateus / gist:9e8a8447a1f199ee9eaf6bdee0a08739
Created February 8, 2022 22:04
statsmodels 0.13.2 build issue
(p39) [ec2-user@ip-172-31-22-97 ~]$ pip install statsmodels -vv
Using pip 22.0.3 from /home/ec2-user/anaconda3/envs/p39/lib/python3.9/site-packages/pip (python 3.9)
Non-user install because site-packages writeable
Created temporary directory: /tmp/pip-ephem-wheel-cache-se1v741j
Created temporary directory: /tmp/pip-req-tracker-hnyt40re
Initialized build tracking at /tmp/pip-req-tracker-hnyt40re
Created build tracker: /tmp/pip-req-tracker-hnyt40re
Entered build tracker: /tmp/pip-req-tracker-hnyt40re
Created temporary directory: /tmp/pip-install-c1qsject
1 location(s) to search for versions of statsmodels:
if w1_root < w2_root:
w1_root, w2_root = w2_root, w1_root
@Strateus
Strateus / l2norm.py
Created November 27, 2015 19:45
L2 Normalize layer for Chainer
class L2Normalize(Function):
def forward(self, inputs):
xp = cuda.get_array_module(*inputs)
x, = inputs
if type(x) is cuda.ndarray:
Xnp = cuda.cupy.asnumpy(x)
self._norm = xp.asarray(xp.expand_dims(np.linalg.norm(Xnp, ord=2, axis=1), axis=1), dtype=xp.float32)
else:
self._norm = xp.expand_dims(np.linalg.norm(x, ord=2, axis=1), axis=1)