Skip to content

Instantly share code, notes, and snippets.

View RaulPPelaez's full-sized avatar

Raul RaulPPelaez

  • Universitat Pompeu Fabra
  • Barcelona
View GitHub Profile
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@yulkang
yulkang / kron.py
Last active February 7, 2024 13:49
Kronecker Product in PyTorch - with batch dimensions broadcast
"""A part of the pylabyk library: numpytorch.py at https://github.com/yulkang/pylabyk"""
import torch
def kron(a, b):
"""
Kronecker product of matrices a and b with leading batch dimensions.
Batch dimensions are broadcast. The number of them mush
:type a: torch.Tensor
:type b: torch.Tensor
:rtype: torch.Tensor
"""
;;
;; linking and capturing
;;
(defun elfeed-link-title (entry)
"Copy the entry title and URL as org link to the clipboard."
(interactive)
(let* ((link (elfeed-entry-link entry))
(title (elfeed-entry-title entry))
(titlelink (concat "[[" link "][" title "]]")))
@ax3l
ax3l / CUDA_Compilers.md
Last active August 29, 2024 02:24
CUDA Compilers