I can run tutorial.
I made a simple programs, it outputs the same error.
import Battle
import re
import numpy as np
import os
import copy
import random
from copy import deepcopy
import matplotlib.pyplot as plt
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from collections import namedtuple
import math
import OriNet


device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

BATCH_SIZE = 128
GAMMA = 0.999
EPS_START = 0.9
EPS_END = 0.05
EPS_DECAY = 200
TARGET_UPDATE = 500
InputNumber = 8
AttackNumber = 6
steps_done = 0
Transition = namedtuple('Transition',
                        ('state', 'action', 'next_state', 'reward'))

AttackList = [1,2,3,4,5,6]

def snippet():
    EPISODE = 2000
    n_actions = 6
    Policy_Net = OriNet.DQN(InputNumber,AttackNumber).to(device)
    Target_Net = OriNet.DQN(InputNumber,AttackNumber).to(device)
    Target_Net.load_state_dict(Policy_Net.state_dict())
    Target_Net.eval()
    optimizer = optim.Adam(Policy_Net.parameters(), lr=0.001)
    memory = OriNet.ReplayMemory(10000)

    def select_action(state):
        global steps_done
        sample = random.random()
        eps_threshold = EPS_END + (EPS_START - EPS_END) * \
            math.exp(-1. * steps_done / EPS_DECAY)
        steps_done += 1
        if sample > eps_threshold:
            with torch.no_grad():
#                print(Policy_Net(state)[0])
                return Policy_Net(state)
        else:
            return torch.tensor([[random.randrange(n_actions)]], device=device, dtype=torch.long)


    def optimize_model():
        if len(memory) < BATCH_SIZE:
            return
        transitions = memory.sample(BATCH_SIZE)
        batch = Transition(*zip(*transitions))

        state_batch = torch.cat(batch.state)
        action_batch = torch.cat(batch.action)
        reward_batch = torch.cat(batch.reward)

#        state_batch = torch.unsqueeze(state_batch,1)


        state_action_values = Policy_Net(state_batch).gather(1, action_batch)

        next_state_values = torch.zeros(BATCH_SIZE, device=device)
#        next_state_values[non_final_mask] = Target_Net(non_final_next_states).max(1)[0].detach()

        non_final_mask = torch.ByteTensor(
            tuple(map(lambda s: s is not None, batch.next_state)))
        non_final_next_states = torch.cat([s for s in batch.next_state
                                                    if s is not None])
        next_state_values[non_final_mask] = Target_Net(
            non_final_next_states).max(1)[0].detach()

        expected_state_action_values = (next_state_values * GAMMA) + reward_batch

        loss = F.smooth_l1_loss(state_action_values, expected_state_action_values.unsqueeze(1))

        optimizer.zero_grad()
        loss.backward()
        for param in Policy_Net.parameters():
            param.grad.data.clamp_(-1, 1)
        optimizer.step()
        print('aaa')

    for i in range(EPISODE):
        inputs = [100,200,300,400,500,600,700,800]
        inputs = np.array(inputs)
        inputs = torch.from_numpy(inputs).type(torch.FloatTensor).to(device)

        Action = select_action(inputs)
        AttackNum = Action[0].to('cpu').detach().numpy().copy()
        Attack = AttackList[np.argmax(AttackNum)]

#      this time, program updates status in this game. 
        NowState = [101,201,301,401,501,601,701,801]
        NowState = np.array(NowState)
        NowState = torch.from_numpy(NowState).type(torch.FloatTensor).to(device)

        reward = 1
        reward = torch.tensor([reward],device = device)

        AttackNum = torch.tensor([[Attack]],device = device)

        memory.push(inputs,AttackNum,NowState,reward)
        optimize_model()



snippet()

DQN model
class ReplayMemory(object):

    def __init__(self, capacity):
        self.capacity = capacity
        self.memory = []
        self.position = 0

    def push(self, *args):
        """Saves a transition."""
        if len(self.memory) < self.capacity:
            self.memory.append(None)
        self.memory[self.position] = Transition(*args)
        self.position = (self.position + 1) % self.capacity

    def sample(self, batch_size):
        return random.sample(self.memory, batch_size)

    def __len__(self):
        return len(self.memory)

class DQN(nn.Module):
    
    def __init__(self, num_states, num_actions):
        super(DQN, self).__init__()
        self.fc1 = nn.Linear(num_states, 32)
        self.fc2 = nn.Linear(32, 32) 
        self.fc3 = nn.Linear(32,32)  
        self.fc4 = nn.Linear(32,12)   
        self.fc5 = nn.Linear(12, num_actions)

    
    def forward(self, x):
        h1 = F.relu(self.fc1(x)) 
        h2 = F.relu(self.fc2(h1))
        h3 = F.relu(self.fc3(h2))
        h4 = F.relu(self.fc4(h3))
        output = self.fc5(h4)
        return output