Skip to content

Commit

Permalink
Fixing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalle Westerling committed Oct 2, 2023
1 parent 1a34a6f commit 1819cd9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions deepsensor/data/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import plum
import copy

from deepsensor import backend
from deepsensor.errors import TaskSetIndexError, GriddedDataError
from . import backend
from ..errors import TaskSetIndexError, GriddedDataError


class Task(dict):
Expand Down
18 changes: 8 additions & 10 deletions deepsensor/model/convnp.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
import copy
import os.path
import json
from typing import Union, List, Literal, Tuple, Optional, types
from typing import Union, List, Literal, Optional
import warnings
from typing import Union, List

import lab as B
import numpy as np
import warnings
from matrix import Diagonal
from plum import ModuleType, dispatch

import deepsensor.data.task
from deepsensor import backend
from deepsensor.data.loader import TaskLoader
from deepsensor.data.processor import DataProcessor
from deepsensor.data.task import (
from .. import backend
from ..data.loader import TaskLoader
from ..data.processor import DataProcessor
from ..data.task import (
Task,
flatten_gridded_data_in_task,
flatten_X,
flatten_Y,
)
from deepsensor.model.defaults import (
from ..model.defaults import (
gen_ppu,
gen_encoder_scales,
gen_decoder_scale,
)
from deepsensor.model.model import DeepSensorModel
from deepsensor.model.nps import (
from ..model.model import DeepSensorModel
from ..model.nps import (
construct_neural_process,
convert_task_to_nps_args,
run_nps_model,
Expand Down
2 changes: 1 addition & 1 deletion deepsensor/model/nps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from deepsensor import backend
from .. import backend
import lab as B

from deepsensor.data.task import Task
Expand Down
4 changes: 2 additions & 2 deletions deepsensor/tensorflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def convert_to_tensor(arr):
return tf.convert_to_tensor(arr)


from deepsensor import config as deepsensor_config
from deepsensor import backend
from .. import config as deepsensor_config
from .. import backend

backend.nps = nps
backend.model = tf.keras.Model
Expand Down
4 changes: 2 additions & 2 deletions deepsensor/torch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def convert_to_tensor(arr):
return torch.tensor(arr)


from deepsensor import config as deepsensor_config
from deepsensor import backend
from .. import config as deepsensor_config
from .. import backend

backend.nps = nps
backend.model = torch.nn.Module
Expand Down

0 comments on commit 1819cd9

Please sign in to comment.