I need to create a conda environment file from the imports that I am using in my python source code. For the sake of simplicity let's say that this is how the imports in my file look like:
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
Now I would like to get an env.yml file that has the latest numpy and pytorch defined as imports.
Is there a way to get this done with a oneliner? Or do I have to do it manually? I couldn't find anything relevant in the conda docs.