I made new commit that make this better. Here is the new output:

Apply
------
<% time> <sum %> <apply time> <time per call> <#call> <id> <Apply name>
   5.5%     5.5%       0.003s       1.07e-03s      3     4 RandomFunction{uniform}(<RandomStateType>, Elemwise{Cast{int32}}.0, <TensorType(f
    input 0: dtype=no dtype, shape=input no shape, strides=input no strides 
    input 1: dtype=int32, shape=(2,), strides=c 
    input 2: dtype=float64, shape=(4,), strides=c 
    input 3: dtype=float64, shape=(3, 1), strides=c 
    output 0: dtype=no dtype, shape=input no shape, strides=input no strides 
    output 1: dtype=float64, shape=(3, 4), strides=c 

and

Memory Profile (the max between all function in that profile)
(Sparse variables are ignored)
---
    Max if linker=cvm (default): unknow
    Max if no gc (allow_gc=False): 3KB
    Max if linker=c|py: 3KB
    Memory saved if gc is enabled (linker=c|py): 0KB

    This list is based on all functions in the profile
    <Sum apply outputs (bytes)> <Apply outputs shape> <created/inplace/view> <Apply node>

          3007B  [None, (10, 1, 3, 2)] c c RandomFunction{multinomial_helper}(<RandomStateType>, Elemwise{Cast{int32}}.0, TensorConstant{9}, <TensorType(float64, 3D)>)
          2783B  [None, (4, 8)] c c RandomFunction{uniform}(<RandomStateType>, Elemwise{Cast{int32}}.0, TensorConstant{0.0}, TensorConstant{1.0})
          2623B  [None, (3, 4)] c c RandomFunction{uniform}(<RandomStateType>, Elemwise{Cast{int32}}.0, <TensorType(float64, vector)>, <TensorType(float64, col)>)
          2623B  [None, (3, 4)] c c RandomFunction{uniform}(<RandomStateType>, Elemwise{Cast{int32}}.0, <TensorType(float64, vector)>, <TensorType(float64, col)>)
          2575B  [None, (3, 2)] c c RandomFunction{multinomial_helper}(<RandomStateType>, TensorConstant{(1,) of 3}, <TensorType(int64, vector)>, <TensorType(float64, matrix)>)
          2575B  [None, (1, 3, 1, 2)] c c RandomFunction{uniform}(<RandomStateType>, Elemwise{Cast{int32}}.0, <TensorType(float64, (False, True, True))>, <TensorType(float64, (True, True, True, False))>)
          2575B  [None, (1, 3, 2)] c c RandomFunction{multinomial_helper}(<RandomStateType>, Elemwise{Cast{int32}}.0, TensorConstant{9}, <TensorType(float64, 3D)>)
          2559B  [None, (4,)] c c RandomFunction{uniform}(<RandomStateType>, TensorConstant{(1,) of 4}, TensorConstant{0.0}, TensorConstant{1.0})
          2559B  [None, (2, 2)] c c RandomFunction{multinomial_helper}(<RandomStateType>, Elemwise{Cast{int32}}.0, <TensorType(int64, vector)>, <TensorType(float64, matrix)>)
          2559B  [None, (4,)] c c RandomFunction{uniform}(<RandomStateType>, Elemwise{Cast{int32}}.0, <TensorType(float64, vector)>, TensorConstant{1})
          2559B  [None, (1, 4)] c c RandomFunction{uniform}(<RandomStateType>, Elemwise{Cast{int32}}.0, <TensorType(float64, vector)>, <TensorType(float64, col)>)
          2551B  [None, (3,)] c c RandomFunction{binomial}(<RandomStateType>, TensorConstant{(1,) of 3}, <TensorType(int32, vector)>, <TensorType(float64, vector)>)
          2551B  [None, (3,)] c c RandomFunction{binomial}(<RandomStateType>, TensorConstant{(1,) of 3}, Elemwise{Cast{int32}}.0, <TensorType(float64, vector)>)
          2551B  [None, (3, 1)] c c RandomFunction{uniform}(<RandomStateType>, Elemwise{Cast{int32}}.0, <TensorType(float64, vector)>, <TensorType(float64, col)>)
          2551B  [None, (3,)] c c RandomFunction{normal}(<RandomStateType>, TensorConstant{(1,) of 3}, <TensorType(float64, vector)>, <TensorType(float64, vector)>)
          2551B  [None, (3,)] c c RandomFunction{normal}(<RandomStateType>, TensorConstant{(1,) of 3}, <TensorType(float64, vector)>, <TensorType(float64, vector)>)
          2551B  [None, (3,)] c c RandomFunction{uniform}(<RandomStateType>, TensorConstant{(1,) of 3}, <TensorType(float64, vector)>, <TensorType(float64, vector)>)
          2551B  [None, (3,)] c c RandomFunction{uniform}(<RandomStateType>, TensorConstant{(1,) of 3}, TensorConstant{0.0}, TensorConstant{1.0})
          2551B  [None, (3,)] c c RandomFunction{uniform}(<RandomStateType>, TensorConstant{(1,) of 3}, <TensorType(float64, vector)>, <TensorType(float64, vector)>)
          2551B  [None, (3,)] c c RandomFunction{random_integers_helper}(<RandomStateType>, TensorConstant{(1,) of 3}, <TensorType(int64, vector)>, <TensorType(int64, vector)>)
   ... (remaining 152 Apply account for 46878B/98834B ((47.43%)) of the Apply with dense outputs sizes)

    <created/inplace/view> is taked from the op declaration.
    Apply nodes marked 'inplace' or 'view' may actually allocate memory, this is not reported here. If you use DebugMode, warnings will be emitted in those cases.