import { Pipe , PipeTransform } from '@angular/core' ; import { Tensor } from './beachball/tensor' ; @ Pipe ( { name : 'sharedTensor' } ) export class TensorPipe implements PipeTransform { param product return { any | null } transform ( product ) { if ( ! product ) { return null ; } return Tensor . fromProduct ( product ) ; } }