func (s *TrainingJob) String() string {
	b, _ := json.MarshalIndent(s, "", "   ")
	return fmt.Sprintf("%s", b)
}
String returns marshal string of TrainingJob
package v1alpha1
import (
	"encoding/json"
	"fmt"
	"k8s.io/apimachinery/pkg/api/resource"
)
func (s *TrainingJob) Elastic() bool {
	return s.Spec.Trainer.MinInstance < s.Spec.Trainer.MaxInstance
}
func (s *TrainingJob) GPU() int {
	q := s.Spec.Trainer.Resources.Limits.NvidiaGPU()
	gpu, ok := q.AsInt64()
	if !ok {
		gpu = 0
	}
	return int(gpu)
}
func (s *TrainingJob) NeedGPU() bool {
	return s.GPU() > 0
}