Develop a Python script to calculate the sum of the squares of all elements in a given array.
[1, 2, 3]
def sum_of_squares(arr):
    sum = 0 
    for num in arr:
        sum += num*num
    return sum

arr = [1,2,3]
sum_of_squares = sum_of_squares(arr)
print(sum_of_squares)