mirror of
https://github.com/wassname/ray.git
synced 2026-09-10 12:38:43 +08:00
ci: Redo format.sh --all script & backfill lint fixes (#9956)
This commit is contained in:
@@ -200,9 +200,13 @@ def get_variable(value,
|
||||
if isinstance(value, float) else tf.int32
|
||||
if isinstance(value, int) else None)
|
||||
return tf.compat.v1.get_variable(
|
||||
tf_name, initializer=value, dtype=dtype, trainable=trainable,
|
||||
**({} if shape is None else {"shape": shape})
|
||||
)
|
||||
tf_name,
|
||||
initializer=value,
|
||||
dtype=dtype,
|
||||
trainable=trainable,
|
||||
**({} if shape is None else {
|
||||
"shape": shape
|
||||
}))
|
||||
elif framework == "torch" and torch_tensor is True:
|
||||
torch, _ = try_import_torch()
|
||||
var_ = torch.from_numpy(value)
|
||||
|
||||
Reference in New Issue
Block a user