@@ -362,7 +362,7 @@ def average(x, axis=None, weights=None):
362
362
x_type = x .get_element_type ()
363
363
weights_type = weights .get_element_type ()
364
364
if (weights_type .is_integral () or weights_type == Type .boolean ) and (
365
- x_type .is_integral () or x_type == Type .boolean
365
+ x_type .is_integral () or x_type == Type .boolean
366
366
):
367
367
x = ov_opset .convert (x , Type .f32 ).output (0 )
368
368
weights = ov_opset .convert (weights , Type .f32 ).output (0 )
@@ -565,7 +565,16 @@ def dot(x, y):
565
565
566
566
567
567
def empty (shape , dtype = None ):
568
- raise NotImplementedError ("`empty` is not supported with openvino backend" )
568
+ if dtype is not None :
569
+ ov_type = OPENVINO_DTYPES [standardize_dtype (dtype )]
570
+ else :
571
+ ov_type = Type .f32
572
+ if isinstance (shape , tuple ):
573
+ shape = list (shape )
574
+ elif isinstance (shape , int ):
575
+ shape = [shape ]
576
+ empty_tensor = ov_opset .parameter (shape , ov_type ).output (0 )
577
+ return OpenVINOKerasTensor (empty_tensor )
569
578
570
579
571
580
def equal (x1 , x2 ):
@@ -712,7 +721,7 @@ def less_equal(x1, x2):
712
721
713
722
714
723
def linspace (
715
- start , stop , num = 50 , endpoint = True , retstep = False , dtype = None , axis = 0
724
+ start , stop , num = 50 , endpoint = True , retstep = False , dtype = None , axis = 0
716
725
):
717
726
raise NotImplementedError (
718
727
"`linspace` is not supported with openvino backend"
0 commit comments