@@ -39,7 +39,7 @@ pub struct GpuModel {
39
39
/// An operation that is performed on the GPU as part of inference
40
40
enum GpuStep {
41
41
/// A statically, pre-filled buffer containing tensor data
42
- Initializer ( Arc < Buffer > ) ,
42
+ Initializer ( ) ,
43
43
44
44
/// A buffer containing tensor data that is obtained from inference input
45
45
Input ( String , Arc < Buffer > ) ,
@@ -582,7 +582,7 @@ impl GpuModel {
582
582
) ,
583
583
buffer : tensor_buffer. clone ( ) ,
584
584
} ) ;
585
- GpuStep :: Initializer ( tensor_buffer )
585
+ GpuStep :: Initializer ( )
586
586
}
587
587
// For inputs we create an empty buffer that can be used at inference time to supply input data
588
588
NodeDefinition :: Input ( input_def) => {
@@ -711,9 +711,8 @@ impl TensorProtoExtra for TensorProto {
711
711
let ints: Vec < i32 > = self
712
712
. get_raw_data ( )
713
713
. iter ( )
714
- . map ( |x| ( * x) . try_into ( ) )
715
- . collect :: < Result < Vec < i32 > , _ > > ( )
716
- . map_err ( |_e| GpuError :: OutOfBoundsError ) ?;
714
+ . map ( |x| ( * x as i32 ) )
715
+ . collect :: < Vec < i32 > > ( ) ;
717
716
let raw_data = bytemuck:: cast_slice ( & ints) ;
718
717
buffer_with_bytes ( device, readable, self . get_name ( ) , raw_data)
719
718
}
@@ -935,7 +934,7 @@ impl GpuStep {
935
934
inputs : & HashMap < String , InputTensor > ,
936
935
) -> Result < ( ) , GpuError > {
937
936
match self {
938
- GpuStep :: None | GpuStep :: Forward ( _) | GpuStep :: Initializer ( _ ) => {
937
+ GpuStep :: None | GpuStep :: Forward ( _) | GpuStep :: Initializer ( ) => {
939
938
// Buffer already filled, no need to encode anything at this point.
940
939
Ok ( ( ) )
941
940
}
0 commit comments