if input_fields.image in tensor_dict:
    num_channels = shape_utils.get_dim_as_int(
        tensor_dict[input_fields.image].shape[2])