Skip to content

Instantly share code, notes, and snippets.

View RaulPPelaez's full-sized avatar

Raul RaulPPelaez

  • Universidad Autonoma de Madrid
  • Madrid
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 December 19, 2024 09: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 May 18, 2025 10:46
CUDA Compilers