drbh commited on
Commit
63f348a
Β·
1 Parent(s): fe983f2

fix: re upload build

Browse files
build/torch27-cxx11-cu118-x86_64-linux/img2gray/{_img2gray_aca891a_dirty.abi3.so β†’ _img2gray_fe983f2_dirty.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:184ad57b89b60c2c6e040e39dcd1e43b25d926e43322e05105f2dc2798b19baa
3
  size 1803528
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d5e74bae644ee5ca293ab6c8d87019321a0115d1f74341b4ce91e694c254ac8
3
  size 1803528
build/torch27-cxx11-cu118-x86_64-linux/img2gray/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _img2gray_4148918_dirty
3
- ops = torch.ops._img2gray_4148918_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_img2gray_4148918_dirty::{op_name}"
 
1
  import torch
2
+ from . import _img2gray_fe983f2_dirty
3
+ ops = torch.ops._img2gray_fe983f2_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_img2gray_fe983f2_dirty::{op_name}"
build/torch27-cxx11-cu126-x86_64-linux/img2gray/{_img2gray_aca891a_dirty.abi3.so β†’ _img2gray_fe983f2_dirty.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7b8fbe6a12d522e8a857fa686d2ac06dab3b282293893c0c90dec2027d800d8e
3
  size 1853168
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36fe29117596a826b26a16b22b9b85ceb8c9c8c5bc1d3504e5420f67ed1188cf
3
  size 1853168
build/torch27-cxx11-cu126-x86_64-linux/img2gray/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _img2gray_4148918_dirty
3
- ops = torch.ops._img2gray_4148918_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_img2gray_4148918_dirty::{op_name}"
 
1
  import torch
2
+ from . import _img2gray_fe983f2_dirty
3
+ ops = torch.ops._img2gray_fe983f2_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_img2gray_fe983f2_dirty::{op_name}"
build/{torch28-cxx11-cu128-x86_64-linux/img2gray/_img2gray_aca891a_dirty.abi3.so β†’ torch27-cxx11-cu128-x86_64-linux/img2gray/_img2gray_fe983f2_dirty.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7037b118e26c406ec2a91085ca5d5898cdee632f73cfe743071f847afc23afd5
3
  size 1924496
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a14ea9d259b6531b1b8d68c2e1c7a19ede78b1e429630a2f65270307bc087609
3
  size 1924496
build/torch27-cxx11-cu128-x86_64-linux/img2gray/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _img2gray_4148918_dirty
3
- ops = torch.ops._img2gray_4148918_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_img2gray_4148918_dirty::{op_name}"
 
1
  import torch
2
+ from . import _img2gray_fe983f2_dirty
3
+ ops = torch.ops._img2gray_fe983f2_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_img2gray_fe983f2_dirty::{op_name}"
build/torch28-cxx11-cu126-x86_64-linux/img2gray/{_img2gray_aca891a_dirty.abi3.so β†’ _img2gray_fe983f2_dirty.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fdd626f3e2006acf69aeee9003a430132c356a57bc48123f30eafffd90d144a4
3
  size 1853168
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00cb31316c604644a3bb9180a167622ed666921e3ab5154f7f07ae1faf910e14
3
  size 1853168
build/torch28-cxx11-cu126-x86_64-linux/img2gray/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _img2gray_4148918_dirty
3
- ops = torch.ops._img2gray_4148918_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_img2gray_4148918_dirty::{op_name}"
 
1
  import torch
2
+ from . import _img2gray_fe983f2_dirty
3
+ ops = torch.ops._img2gray_fe983f2_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_img2gray_fe983f2_dirty::{op_name}"
build/{torch27-cxx11-cu128-x86_64-linux/img2gray/_img2gray_aca891a_dirty.abi3.so β†’ torch28-cxx11-cu128-x86_64-linux/img2gray/_img2gray_fe983f2_dirty.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ee70fd276c19241aa50af9453c168d7bda2b0e08ef58372f529569c5d1ea844d
3
  size 1924496
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6aee1662d13a44c365281710eebc631f6d9eeb160b040dd8ba59eeb5b7b610f4
3
  size 1924496
build/torch28-cxx11-cu128-x86_64-linux/img2gray/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _img2gray_4148918_dirty
3
- ops = torch.ops._img2gray_4148918_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_img2gray_4148918_dirty::{op_name}"
 
1
  import torch
2
+ from . import _img2gray_fe983f2_dirty
3
+ ops = torch.ops._img2gray_fe983f2_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_img2gray_fe983f2_dirty::{op_name}"
build/torch28-cxx11-cu129-x86_64-linux/img2gray/{_img2gray_aca891a_dirty.abi3.so β†’ _img2gray_fe983f2_dirty.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:68551acc1d4ec87b1822a2aa727bd18333b8f348fe01243b9f59ceaf563e5af3
3
  size 1950088
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b23c44f236125a7ea7b3a942cdc5ee66e11243cccf15cbe3fbf3a633791b567a
3
  size 1950088
build/torch28-cxx11-cu129-x86_64-linux/img2gray/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _img2gray_4148918_dirty
3
- ops = torch.ops._img2gray_4148918_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_img2gray_4148918_dirty::{op_name}"
 
1
  import torch
2
+ from . import _img2gray_fe983f2_dirty
3
+ ops = torch.ops._img2gray_fe983f2_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_img2gray_fe983f2_dirty::{op_name}"
test_kernel.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = "==3.10"
3
+ # dependencies = [
4
+ # "kernels",
5
+ # "numpy",
6
+ # "pillow",
7
+ # "torch",
8
+ # ]
9
+ # ///
10
+ import torch
11
+ from PIL import Image
12
+ import numpy as np
13
+ from kernels import get_kernel
14
+
15
+ # This downloads, caches, and loads the kernel library
16
+ # and makes the custom op available in torch.ops
17
+ img2gray_lib = get_kernel("drbh/img2gray")
18
+
19
+ img = Image.open("kernel-builder-logo-color.png").convert("RGB")
20
+ img = np.array(img)
21
+ img_tensor = torch.from_numpy(img).cuda()
22
+ print(img_tensor.shape) # HWC
23
+
24
+ gray_tensor = img2gray_lib.img2gray(img_tensor).squeeze()
25
+ print(gray_tensor.shape) # HW
26
+
27
+ # save the output image
28
+ gray_img = Image.fromarray(gray_tensor.cpu().numpy().astype(np.uint8), mode="L")
29
+ gray_img.save("kernel-builder-logo-gray2.png")