#!/bin/bash
function dls_get_executor {
local filename="$(basename -- "$1")"
local extension="${filename##*.}"
extension="$(echo "$extension" | tr '[:upper:]' '[:lower:]')"
case "$extension" in
py|pyc|pyw|pyo|pyd)
which python
;;
sh)
which bash
;;
*)
;;
esac
}
function set_env {
local install_path=/usr/local/Ascend
if [ -d ${install_path}/ascend-toolkit/latest ]; then
source ${install_path}/ascend-toolkit/set_env.sh
elif [ -d ${install_path}/nnae/latest ]; then
source ${install_path}/nnae/set_env.sh
fi
if [ -d ${install_path}/tfplugin/latest ]; then
source ${install_path}/tfplugin/set_env.sh
fi
}
function logger {
echo "[$(date +%Y%m%d-%H:%M:%S)] [MindXDL Service Log]$*"
}