Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def save_tensor(cloud_pickler, tensor, name=None):
val = tf.get_static_value(tensor)
if val is None:
raise ValueError('Cannot pickle Tensor -- '
'its value is not known statically: {}.'.format(tensor))
CloudPickler.save_reduce(cloud_pickler, np.array, (val,))