Skip to content

Commit

Permalink
small additions (#130)
Browse files Browse the repository at this point in the history
* add torch.fft dummy

* add Tensor.cuda

* Tensor.flatten allow start and end dim
  • Loading branch information
vieting authored Dec 7, 2022
1 parent 8fa7e93 commit 5c17327
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Empty file added pytorch_to_returnn/torch/fft.py
Empty file.
7 changes: 5 additions & 2 deletions pytorch_to_returnn/torch/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,18 @@ def clone(self):
def cpu(self):
return self # ignore

def cuda(self):
return self # ignore

@property
def device(self):
class DeviceDummy:
type = None
return DeviceDummy()

def flatten(self):
def flatten(self, start_dim=0, end_dim=-1):
from .nn.functional import flatten
return flatten(self)
return flatten(self, start_dim, end_dim)

def view(self, *shape):
from .nn.functional import reshape
Expand Down

0 comments on commit 5c17327

Please sign in to comment.