array_to_scalar: pytorch doesn't support array_to_scalar
ethancaballero opened this issue · 0 comments
ethancaballero commented
e.g. the sum in last line (111) of:
https://github.com/mila-iqia/myia/blob/master/examples/mlp.py#L107-L111
def cost(model, x, target):
"""Square difference loss."""
y = model.apply(x)
diff = target - y
return sum(diff * diff)