Skip to content

Instantly share code, notes, and snippets.

@tchaton
Last active December 6, 2020 20:17
Show Gist options
  • Save tchaton/8b2e3e5275d2ce66bbfd8e094947cb5a to your computer and use it in GitHub Desktop.
Save tchaton/8b2e3e5275d2ce66bbfd8e094947cb5a to your computer and use it in GitHub Desktop.
from typing import List, Optional, NamedTuple
# use to make model jittable
OptTensor = Optional[Tensor]
ListTensor = List[Tensor]
class TensorBatch(NamedTuple):
x: Tensor
edge_index: ListTensor
edge_attr: OptTensor
batch: OptTensor
class DNAConvNet(LightningModule):
...
def forward(self, batch: TensorBatch):
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment