2

I am trying to follow some code in python 3.5 and I am still super newb level.

I have the following imports but I'm not sure what the differences are with the ones that begin with '.'?

import os
import time
import random
import numpy as np
from tqdm import tqdm
import tensorflow as tf

from .base import BaseModel
from .history import History
from .replay_memory import ReplayMemory
from .ops import linear, conv2d, clipped_error
from utils import get_time, save_pkl, load_pkl

For example .base .history .replay_memory .ops

Where is it getting those modules? Are they getting them as a subset of one of the earlier modules?

Jerry
  • 133
  • 10

1 Answers1

4

It is a so called relative import see here and refers to modules or packages located in the same directory. (More precisely, in the same package, which in most but not all cases will be the same thing.)

Paul Panzer
  • 51,835
  • 3
  • 54
  • 99