Skip to content

Commit

Permalink
Merge pull request #3899 from ggosline/pytorch_2.0_compiler
Browse files Browse the repository at this point in the history
Pytorch 2.0 compiler
  • Loading branch information
jph00 committed Mar 28, 2023
2 parents 930d3e9 + 909b673 commit 125d2ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fastai/layers.py
Expand Up @@ -68,7 +68,7 @@ def __repr__(self): return f'{self.__class__.__name__}({self.repr})'
@module(full=False)
def Flatten(self, x):
"Flatten `x` to a single dimension, e.g. at end of a model. `full` for rank-1 tensor"
return TensorBase(x.view(-1) if self.full else x.view(x.size(0), -1))
return x.view(-1) if self.full else x.view(x.size(0), -1) # Removed cast to Tensorbase

# %% ../nbs/01_layers.ipynb 15
@module(tensor_cls=TensorBase)
Expand Down
2 changes: 1 addition & 1 deletion nbs/01_layers.ipynb
Expand Up @@ -190,7 +190,7 @@
"@module(full=False)\n",
"def Flatten(self, x):\n",
" \"Flatten `x` to a single dimension, e.g. at end of a model. `full` for rank-1 tensor\"\n",
" return TensorBase(x.view(-1) if self.full else x.view(x.size(0), -1))"
" return x.view(-1) if self.full else x.view(x.size(0), -1) # Removed cast to Tensorbase"
]
},
{
Expand Down

0 comments on commit 125d2ef

Please sign in to comment.