update code styles
This commit is contained in:
		| @@ -1,4 +1,3 @@ | ||||
| import torch | ||||
| import torch.nn as nn | ||||
| from copy import deepcopy | ||||
| from ..cell_operations import OPS | ||||
|   | ||||
| @@ -68,7 +68,7 @@ class Structure: | ||||
|     for i, node_info in enumerate(self.nodes): | ||||
|       sums = [] | ||||
|       for op, xin in node_info: | ||||
|         if op == 'none' or nodes[xin] == False: x = False | ||||
|         if op == 'none' or nodes[xin] is False: x = False | ||||
|         else: x = True | ||||
|         sums.append( x ) | ||||
|       nodes[i+1] = sum(sums) > 0 | ||||
|   | ||||
| @@ -85,7 +85,7 @@ class SearchCell(nn.Module): | ||||
|           candidates = self.edges[node_str] | ||||
|           select_op  = random.choice(candidates) | ||||
|           sops.append( select_op ) | ||||
|           if not hasattr(select_op, 'is_zero') or select_op.is_zero == False: has_non_zero=True | ||||
|           if not hasattr(select_op, 'is_zero') or select_op.is_zero is False: has_non_zero=True | ||||
|         if has_non_zero: break | ||||
|       inter_nodes = [] | ||||
|       for j, select_op in enumerate(sops): | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import math, torch | ||||
| import math | ||||
| import torch.nn as nn | ||||
| import torch.nn.functional as F | ||||
| from ..initialization import initialize_resnet | ||||
|   | ||||
		Reference in New Issue
	
	Block a user