tensorflow/compiler/mlir/tensorflow/transforms/tpu_space_to_depth_pass.cc
// Get block argument id and number of users for the input arg.
Get block argument id and number of users for the input arg.
Get block argument id and number of users for the input arg .
Optional<BlockArgumentInfo> GetBlockArgNum(Value arg) {
  if (auto block_arg = arg.dyn_cast<mlir::BlockArgument>()) {
    if (!Conv2DInputShapeCanTransform(arg)) return None;
    unsigned num_users =
        std::distance(block_arg.getUsers().begin(), block_arg.getUsers().end());
    BlockArgumentInfo block_arg_info = {block_arg.getArgNumber(), num_users};
    return block_arg_info;
  }
  return None;
}
Optional < BlockArgumentInfo > GetBlockArgNum ( Value arg ) { if ( auto block_arg = arg . dyn_cast < mlir :: BlockArgument > ( ) ) { if ( ! Conv2DInputShapeCanTransform ( arg ) ) return None ; unsigned num_users = std :: distance ( block_arg . getUsers ( ) . begin ( ) , block_arg . getUsers ( ) . end ( ) ) ; BlockArgumentInfo block_arg_info = { block_arg . getArgNumber ( ) , num_users } ; return block_arg_info ; } return None ; }
Get block argument id and number of users for the input arg.
Get block argument id and number of users for the input arg .