Leaf node instances

Is there an API or way to calculate number of instances fall into each leaf node after training.