tensorflow/compiler/xla/python/transfer_guard_lib.cc
// Returns the transfer guard action for a transfer.
Returns the transfer guard action for a transfer.
Returns the transfer guard action for a transfer .
TransferGuardAction GetTransferGuardAction(TransferGuardLevel guard_level,
                                           bool explicit_transfer) {
  switch (guard_level) {
    case TransferGuardLevel::kAllow:
      return TransferGuardAction::kAllow;
    case TransferGuardLevel::kLog:
      if (explicit_transfer) {
        return TransferGuardAction::kAllow;
      } else {
        return TransferGuardAction::kLog;
      }
    case TransferGuardLevel::kDisallow:
      if (explicit_transfer) {
        return TransferGuardAction::kAllow;
      } else {
        return TransferGuardAction::kDisallow;
      }
    case TransferGuardLevel::kLogExplicit:
      return TransferGuardAction::kLog;
    case TransferGuardLevel::kDisallowExplicit:
      return TransferGuardAction::kDisallow;
    default:
      return TransferGuardAction::kDisallow;
  }
}
TransferGuardAction GetTransferGuardAction ( TransferGuardLevel guard_level , bool explicit_transfer ) { switch ( guard_level ) { case TransferGuardLevel :: kAllow : return TransferGuardAction :: kAllow ; case TransferGuardLevel :: kLog : if ( explicit_transfer ) { return TransferGuardAction :: kAllow ; } else { return TransferGuardAction :: kLog ; } case TransferGuardLevel :: kDisallow : if ( explicit_transfer ) { return TransferGuardAction :: kAllow ; } else { return TransferGuardAction :: kDisallow ; } case TransferGuardLevel :: kLogExplicit : return TransferGuardAction :: kLog ; case TransferGuardLevel :: kDisallowExplicit : return TransferGuardAction :: kDisallow ; default : return TransferGuardAction :: kDisallow ; } }
Returns the transfer guard action for a transfer.
Returns the transfer guard action for a transfer .
// Unreachable; gracefully handle the unexpected guard level and prevent a // compiler warning.