Skip to content

Commit 2caf084

Browse files
authored
Support cached_property for python version < 3.8 (#171)
1 parent 36ca824 commit 2caf084

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
backports.cached_property
2+
numpy
3+
tqdm
4+
typing-extensions
5+
wheel

torchsparse/nn/modules/conv.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import math
2-
from functools import cached_property
2+
import sys
33
from typing import Dict, List, Tuple, Union
44

5+
if sys.version_info >= (3, 8):
6+
from functools import cached_property
7+
else:
8+
from backports.cached_property import cached_property
9+
510
import numpy as np
611
import torch
712
from torch import nn

0 commit comments

Comments
 (0)