neuromancer.utils module

neuromancer.utils.handle_device_placement(func)[source]

This is a decorator to handle automated GPU support for Neuromancer constraints. It decorates a forward method that takes in two tensors (left and right) and ensures both tensors reside on the same non-cpu device (if a GPU is available)

neuromancer.utils.load_state_dict_lightning(problem, weight_path)[source]

This function handles loading problem weights when said problem was trained using LitTrainer method

Parameters:
  • problem – A Neuromancer Problem

  • weight_path – (str) Path to weights saved by LitTrainer method