答案 0 :(得分:3)
使用:
a_holder = tf.placeholder(np.float32)
b = tf.Variable(a_holder)
sess.run(b.initializer, feed_dict={a_holder: np.arange(100000000)})
答案 1 :(得分:0)
您需要创建一个RefreshScopeHealthIndicator
的bean并重写doHealthCheck
方法,以免引发异常。代码段是Kotlin,但您会明白的。
@Component
class CustomHealthIndicator(
private val scope: ObjectProvider<RefreshScope>,
private val rebinder: ConfigurationPropertiesRebinder
): RefreshScopeHealthIndicator(scope, rebinder) {
override fun doHealthCheck(builder: Health.Builder) {
builder.up()
}
}