Dear albanD, thank you for the explanations of the gather () function. I haven’t fully understood it yet, but now I know which way to look for more information. Links are welcome 
Unfortunately, I’m back earlier than I thought, with bad news. I’ve installed PyTorch in a conda-env called “test232”, MKL should work. But nothing has changed. I did some tests and I would like to show you the results.
(test232) [user@localhost lib]$ python --version
Python 3.7.4

(test232) [user@localhost lib]$ which python
~/.conda/envs/test232/bin/python

(test232) [user@localhost /]$ python -c 'import torch; print(torch.__path__)'
['/home/user/.conda/envs/test232/lib/python3.7/site-packages/torch']

(test232) [user@localhost /]$ cd /home/user/.conda/envs/test232/lib/python3.7/site-packages/torch
(test232) [user@localhost torch]$ cd lib
(test232) [user@localhost lib]$ ldd libtorch.so
	linux-vdso.so.1 (0x00007ffe21549000)
	libgomp.so.1 => /home/user/.conda/envs/test232/lib/python3.7/site-packages/torch/lib/./../../../../libgomp.so.1 (0x00007256b0ed9000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007256b0e99000)
	librt.so.1 => /lib64/librt.so.1 (0x00007256b0e8f000)
	libgcc_s.so.1 => /home/user/.conda/envs/test232/lib/python3.7/site-packages/torch/lib/./../../../../libgcc_s.so.1 (0x00007256b0e7b000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007256b0e75000)
	libmkl_intel_lp64.so => /home/user/.conda/envs/test232/lib/python3.7/site-packages/torch/lib/./../../../../libmkl_intel_lp64.so (0x00007256b0309000)
	libmkl_gnu_thread.so => /home/user/.conda/envs/test232/lib/python3.7/site-packages/torch/lib/./../../../../libmkl_gnu_thread.so (0x00007256aea2e000)
	libmkl_core.so => /home/user/.conda/envs/test232/lib/python3.7/site-packages/torch/lib/./../../../../libmkl_core.so (0x00007256aa70e000)
	libm.so.6 => /lib64/libm.so.6 (0x00007256aa5c8000)
	libc10.so => /home/user/.conda/envs/test232/lib/python3.7/site-packages/torch/lib/./libc10.so (0x00007256aa36f000)
	libstdc++.so.6 => /home/user/.conda/envs/test232/lib/python3.7/site-packages/torch/lib/./../../../../libstdc++.so.6 (0x00007256aa1fb000)
	libc.so.6 => /lib64/libc.so.6 (0x00007256aa035000)
	/lib64/ld-linux-x86-64.so.2 (0x00007256b687c000)
	
(test232) [user@localhost lib]$ python -c 'import torch; a = torch.randn(10); print(a.to_mkldnn().layout)'
torch._mkldnn

BOOT LOOP
        while not done:
            #////////////////////////////////////////////////
            SYS.ENV['STEPS'] += 1
            #////////////////////////////////////////////////
            action = SYS.AGT['CALL'].get_action1(SYS, state)
            #////////////////////////////////////////////////
            next_state, reward, done, info = SYS.ENV['CALL'].step(action)
            #////////////////////////////////////////////////
            SYS.AGT['CALL'].remember(state, action, reward, next_state, done)
            #////////////////////////////////////////////////
            state = deepcopy(next_state)
            #////////////////////////////////////////////////
            tqdm_e.update(1)
            #////////////////////////////////////////////////
            if(SYS.AGT['CALL'].get_mem_size() >= request):
                tqdm_e.refresh()
                tqdm_e.close()
                return(True)

I’ve created some different get_action() functions, the old (from above) is get_action1(), you already know it:
    def get_action1(self, SYS, state): # (PyTorch)
        #////////////////////////////////////////////////
        self.epsilon = SYS.AGT['EPSILON']
        self.action  = -1 # set to invalid value
        #////////////////////////////////////////////////
        self.state = torch.from_numpy(state).float().unsqueeze(0)
        #////////////////////////////////////////////////
        self.DQN.model.eval()
        #////////////////////////////////////////////////
        with torch.no_grad():
            qvals = self.DQN.predict(self.state).numpy()
        #////////////////////////////////////////////////
        self.action = np.argmax(qvals[0])
        #////////////////////////////////////////////////
        return(self.action)

and
    def get_action2(self, SYS, state):
        #////////////////////////////////////////////////
        self.epsilon = SYS.AGT['EPSILON']
        self.action  = -1 # set to invalid value
        #////////////////////////////////////////////////
        self.state = torch.as_tensor(state, dtype=torch.float32).unsqueeze(0)
        #////////////////////////////////////////////////
        # self.DQN.model.eval()
        #////////////////////////////////////////////////
        with torch.no_grad():
            qvals = self.DQN.model(self.state)
        #////////////////////////////////////////////////
        self.action = torch.argmax(qvals, dim=1).item()
        #////////////////////////////////////////////////
        return(self.action)

I’ve increased my memory size to 32.000 to get stable measures:
Keras/Theano backend
bootstrap examples: 100%|██████████| 32000/32000 [00:10<00:00, 3098.43 item(s)/s]
PyTorch without MKL using get_action1()
python: /usr/bin/python3
torch.path: /home/user/.local/lib/python3.7/site-packages/torch
bootstrap examples: 100%|██████████| 32000/32000 [00:15<00:00, 2085.01 item(s)/s]
PyTorch with MKL using get_action1()
python: /home/user/.conda/envs/test232/bin/python
torch.path: /home/user/.conda/envs/test232/lib/python3.7/site-packages/torch
bootstrap examples: 100%|██████████| 32000/32000 [00:15<00:00, 2054.94 item(s)/s]
PyTorch with MKL using get_action2()
python: /home/user/.conda/envs/test232/bin/python
torch.path: /home/user/.conda/envs/test232/lib/python3.7/site-packages/torch
bootstrap examples: 100%|██████████| 32000/32000 [00:13<00:00, 2319.04 item(s)/s]
A small speed increase but unfortunately it is still slower than Keras with the Theano backend.
To rule out that data processing (data in numpy) is the bottleneck, I created get_action3():
self.state is now only ONCE initialized to zeros
    def get_action3(self, SYS, state):
        #////////////////////////////////////////////////
        # self.state = torch.as_tensor(state, dtype=torch.float32).unsqueeze(0)
        #////////////////////////////////////////////////
        # self.DQN.model.eval()
        #////////////////////////////////////////////////
        with torch.no_grad():
            qvals = self.DQN.model(self.state) # <<< self.state is now only initialized to zeros
        #////////////////////////////////////////////////
        self.action = torch.argmax(qvals, dim=1).item()
        #////////////////////////////////////////////////
        return(self.action)

PyTorch with MKL using get_action3()
python: /home/user/.conda/envs/test232/bin/python
torch.path: /home/user/.conda/envs/test232/lib/python3.7/site-packages/torch
bootstrap examples: 100%|██████████| 32000/32000 [00:13<00:00, 2439.39 item(s)/s]
To see how fast the speed is when no get_action() function is called, I changed the corresponding line in the boot loop:
BOOT LOOP without get_action() call
        while not done:
            #////////////////////////////////////////////////
            SYS.ENV['STEPS'] += 1
            #////////////////////////////////////////////////
            action = 0 # no get_action() call
            #////////////////////////////////////////////////
            next_state, reward, done, info = SYS.ENV['CALL'].step(action)
            #////////////////////////////////////////////////
            SYS.AGT['CALL'].remember(state, action, reward, next_state, done)
            #////////////////////////////////////////////////
            state = deepcopy(next_state)
            #////////////////////////////////////////////////
            tqdm_e.update(1)
            #////////////////////////////////////////////////
            if(SYS.AGT['CALL'].get_mem_size() >= request):
                tqdm_e.refresh()
                tqdm_e.close()
                return(True)

That shows the maximum speed that my code/environment can deliver, including storing new data.
bootstrap examples: 100%|██████████| 32000/32000 [00:01<00:00, 26063.70 item(s)/s]
I’m really sorry to say that, but unfortunately it looks like PyTorch can’t keep up.