Skip to content

Instantly share code, notes, and snippets.

View Ryu1845's full-sized avatar
🎯
Focusing

Sofian Mejjoute Ryu1845

🎯
Focusing
View GitHub Profile
@Ryu1845
Ryu1845 / convnext.py
Last active August 5, 2024 11:57 — forked from amirshamaei/convnext.py
A ConvNet for the 2020s (1D version)
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
@Ryu1845
Ryu1845 / split.py
Last active March 18, 2023 19:45 — forked from ptrblck/numpy split vs PyTorch split
numpy split vs PyTorch split
import torch
import numpy as np
# numpy
a = np.random.rand(10, 20)
tmp0 = np.split(a, indices_or_sections=5, axis=0) # split into 5 sections
for t in tmp0:
print(t.shape)
# (2, 20)
# (2, 20)