Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-gopichand committed Aug 21, 2024
1 parent 01f04ff commit ef837d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rapidai/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.3"
__version__ = "0.0.4"
1 change: 1 addition & 0 deletions rapidai/_modidx.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
'rapidai.augment.summary': ('augment.html#summary', 'rapidai/augment.py')},
'rapidai.conv': { 'rapidai.conv.collate_device': ('convolutions.html#collate_device', 'rapidai/conv.py'),
'rapidai.conv.conv': ('convolutions.html#conv', 'rapidai/conv.py'),
'rapidai.conv.device': ('convolutions.html#device', 'rapidai/conv.py'),
'rapidai.conv.to_device': ('convolutions.html#to_device', 'rapidai/conv.py')},
'rapidai.core': {'rapidai.core.foo': ('core.html#foo', 'rapidai/core.py')},
'rapidai.datasets': { 'rapidai.datasets.DataLoaders': ('datasets.html#dataloaders', 'rapidai/datasets.py'),
Expand Down
5 changes: 4 additions & 1 deletion rapidai/conv.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/03_convolutions.ipynb.

# %% auto 0
__all__ = ['def_device', 'conv', 'to_device', 'collate_device']
__all__ = ['def_device', 'conv', 'device', 'to_device', 'collate_device']

# %% ../nbs/03_convolutions.ipynb 2
import torch
Expand All @@ -22,6 +22,9 @@ def conv(ni, nf, ks=3, stride=2, act=True):
# %% ../nbs/03_convolutions.ipynb 74
def_device = 'mps' if torch.backends.mps.is_available() else 'cuda' if torch.cuda.is_available() else 'cpu'

def device():
return 'mps' if torch.backends.mps.is_available() else 'cuda' if torch.cuda.is_available() else 'cpu'

def to_device(x, device=def_device):
if isinstance(x, torch.Tensor): return x.to(device)
if isinstance(x, Mapping): return {k:v.to(device) for k,v in x.items()}
Expand Down
2 changes: 1 addition & 1 deletion settings.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[DEFAULT]
repo = rapidai
lib_name = rapidai
version = 0.0.3
version = 0.0.4
min_python = 3.9
license = apache2
black_formatting = False
Expand Down

0 comments on commit ef837d6

Please sign in to comment.