Skip to content

Instantly share code, notes, and snippets.

@bayerj
Created March 14, 2012 10:41
Show Gist options
  • Select an option

  • Save bayerj/2035682 to your computer and use it in GitHub Desktop.

Select an option

Save bayerj/2035682 to your computer and use it in GitHub Desktop.
In [87]: A, B = np.ones((1, 2)), np.random.random((3, 3, 1))
In [88]: B
Out[88]:
array([[[ 0.02738198],
[ 0.23332334],
[ 0.12513209]],
[[ 0.48753864],
[ 0.45401342],
[ 0.85095945]],
[[ 0.14610477],
[ 0.81083541],
[ 0.25780549]]])
In [89]: A * B
Out[89]:
array([[[ 0.02738198, 0.02738198],
[ 0.23332334, 0.23332334],
[ 0.12513209, 0.12513209]],
[[ 0.48753864, 0.48753864],
[ 0.45401342, 0.45401342],
[ 0.85095945, 0.85095945]],
[[ 0.14610477, 0.14610477],
[ 0.81083541, 0.81083541],
[ 0.25780549, 0.25780549]]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment