try:
self.size = int(self.size)
except ValueError:
raise ParsingError("Key "size" in Dense layer must be an integer.")
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
def _build(self, backend):
Create the backend-specific placeholder.
After Change
if isinstance(self.args, dict):
self.size = engine.evaluate(self.args["size"], recursive=True)
elif isinstance(self.args, list):
self.size = engine.evaluate(self.args, recursive=True)
else:
self.size = self.args
if not isinstance(self.size, (tuple, list)):
self.size = [self.size]
try:
for i, v in enumerate(self.size):
self.size[i] = int(v)
except ValueError:
raise ParsingError("Key "size" in Dense layer must be an integer "
"or a list of integers. Received: {}".format(self.size))