Skip to content
Advertisement

Tag: factorial

Using primitive operators to find factorial of N up to K depth

Having difficulty coming up with a solution using: iteration/control-flow and accumulation. More than just a solution, would prefer having an answer with hints and explanation. Answer Ignoring k=0 you have want to multiply k numbers starting with n and ending with n-k. The above loops k times and since i will increment by 1 starting from 0, you can simply

How to calculate factorial in tensorflow?

I am new to tensorflow, I am trying to find a function that calculates the n!. I saw that one can use the gamma function, which was possible with theano, but did not work for tensorflow. I am using a for loop to multiply number from n to 1, but I assume there is an easier and faster way. I

Advertisement